Skip to content

Instantly share code, notes, and snippets.

@agile
Created July 23, 2008 20:33
Show Gist options
  • Save agile/1896 to your computer and use it in GitHub Desktop.
Save agile/1896 to your computer and use it in GitHub Desktop.
my_time_formats = {
:date_time12 => "%m/%d/%y %I:%M%p",
:date_time24 => "%m/%d/%y %H:%M",
:file => "%Y-%m-%d-%H-%M%p",
:search => "%m/%d/%Y",
:default => "%m/%d/%y %I:%M%p"
}
my_date_formats = {
:date_time12 => "%m/%d/%y",
:date_time24 => "%m/%d/%y",
:file => "%Y-%m-%d",
:search => "%m/%d/%Y",
:default => "%m/%d/%y"
}
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(my_time_formats)
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(my_date_formats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment