Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created June 27, 2010 18:09
Show Gist options
  • Save jhsu/455059 to your computer and use it in GitHub Desktop.
Save jhsu/455059 to your computer and use it in GitHub Desktop.
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:simple => "%I:%M %p %Z, %Y-%m-%d",
:month_year => '%b %Y',
:month => '%B',
:year => '%Y',
:day_of_week => '%a',
:day => '%Y-%b-%d',
:date => '%Y-%b-%d',
:default => '%b %d, %Y at %I:%M %p %Z',
:datetime => '%Y-%m-%d at %I:%M %p %Z',
:time => '%I:%M%P %Z',
:us => '%b %d, %Y',
:us_no_year => '%b %d',
:date_time12 => "%m/%d/%Y %I:%M%p",
:date_time24 => "%m/%d/%Y %H:%M",
:iso_8601_date_only => "%Y-%m-%d",
:iso_8601_time_only => "%H:%M:%S%z"
)
= Time.now.to_s(:simple)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment