Date arithmetic in Ruby is possible because Ruby’s time objects are stored internally as numbers. Additions to dates and differences between dates are handled by adding to and subtracting the underlying numbers. Time and DateTime objects are a bit different. Time is a wrapper for the Unix or POSIX standard time defined as the number [...]
Posts Tagged ‘date’
Date Arithmetic
Posted in ruby, rubyonrails, tagged date, ruby, rubyonrails, time on December 25, 2008 | Leave a Comment »
Formatting Dates and Floats in Ruby
Posted in ruby, rubyonrails, tagged date, datetime, float, formatting, rails, ruby, rubyonrails on September 24, 2008 | 2 Comments »
There are a couple of functions which you have to look up in any
language again and again, because they are slighty different in
each language, especially those for formatting of dates and
floating point numbers.
To display dates and datetimes in different formats in Ruby on
Rails applications, the following list for default formats
may help. The default date formats [...]