A quick gist on how to extend date formats in rails 3.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Rails 2
# config/initializers/date_formats.rb
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
 :date => '%m/%d/%Y',
 :date_time12  => "%m/%d/%Y %I:%M%p",
 :date_time24  => "%m/%d/%Y %H:%M"
)

# Rails 3
# config/initializers/date_formats.rb
Time::DATE_FORMATS.merge!(
 :date => '%m/%d/%Y',
 :date_time12  => "%m/%d/%Y %I:%M%p",
 :date_time24  => "%m/%d/%Y %H:%M"
)