[LRUG] extending Time for use throughout rails

David Salgado david at digitalronin.com
Fri Dec 28 10:53:12 PST 2007


See this thread for a nicer way to achieve this;

    http://www.ruby-forum.com/topic/57923

Basically, add the following to the bottom of your
config/environment.rb file, and use your_date_object.to_s(:geek) in
your code;

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
  :geek => '%Y-%m-%d'
)

Hope this helps

David



More information about the Chat mailing list