ISO 8601 Dates in Ruby on Rails

Posted by Daniel Butler Thu, 13 Apr 2006 19:26:00 GMT

If you would like ISO 8601 time and date formatting by default in your Ruby on Rails application, add the following code to your environment.rb file:

ActiveSupport::CoreExtensions::Time::Conversions::DATE_
FORMATS.update(:default => '%Y-%m-%d %H:%M:%S')
ActiveSupport::CoreExtensions::Date::Conversions::DATE_
FORMATS.update(:default => '%Y-%m-%d')

Read more...

Posted in ,  | Tags , ,  | 1 comment

Older posts: 1 ... 6 7 8