Skip to content

Instantly share code, notes, and snippets.

Created September 7, 2010 05:56
Show Gist options
  • Save anonymous/567925 to your computer and use it in GitHub Desktop.
Save anonymous/567925 to your computer and use it in GitHub Desktop.
# 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"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment