[Stamp Gem(Stamp Gem)][1]
Stamp gem is the best gem for converting format of Dates and Times in Human friendly formats.
Its very easy to use in our rails application.
We can use this gem as:
run:
gem install stamp
or inlude this line in gem file
gem 'stamp'
then run:
bundle install.
Example:
Suppose, I have a date = 2014-01-15 18:19:07 +0530
then we can convert this date into humans friendly date format like
date.stamp('1-Jan-2000') => '15-Jan-2014'
date.stamp('1st Jan') => '15th Jan'
date.stamp('Jan 1, 2000') => 'Jan 15, 2014'
date.stamp('Jan 01') => 'Jan 15'
date.stamp('01-Jan-2000, 00:00') => '15-Jan-2014, 18:19'
date.stamp('01-Jan-2000, 00:00 AM') => '15-Jan-2014, 18:19 PM'
For more details [click here Stamp gem][2]
[1]: https://github.com/jeremyw/stamp
[2]: https://github.com/jeremyw/stamp