diff --git a/README b/README index d17d2c8..2cb32b9 100644 --- a/README +++ b/README @@ -16,3 +16,19 @@ You can use the difference like: diff[:year], diff[:month], diff[:week] + +Formatted Time difference +------------------------- + +%y - year +%M - month +%w - week +%d - day +%h - hour +%m - minute +%s - second + +By default the format is '%y, %M, %w, %d and %h:%m:%s' this will return '1 year, 2 months, 3 weeks, 4 days and 12:05:52'. +You will get the result from the output hash, time_diff_components[:diff] + +You can pass your own format as third parameter to this function. diff --git a/README.rdoc b/README.rdoc index 0cb42ae..05f8a14 100644 --- a/README.rdoc +++ b/README.rdoc @@ -8,13 +8,28 @@ gem install time_diff require 'time_diff' -diff = Time.diff(start_date_time, end_date_time) +time_diff_components = Time.diff(start_date_time, end_date_time) This will return the hash of time difference in terms of years, month, week, day, hour, minute and second. You can use the difference like: -diff[:year], diff[:month], diff[:week] +time_diff_components[:year], time_diff_components[:month], time_diff_components[:week] + +==Formatted Time difference + +%y - year +%M - month +%w - week +%d - day +%h - hour +%m - minute +%s - second + +By default the format is '%y, %M, %w, %d and %h:%m:%s' this will return '1 year, 2 months, 3 weeks, 4 days and 12:05:52'. +You will get the result from the output hash, time_diff_components[:diff] + +You can pass your own format as third parameter to this function. == Contributing to time_diff diff --git a/VERSION b/VERSION index 17e51c3..227cea2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +2.0.0