Skip to content

Instantly share code, notes, and snippets.

@millisami
Forked from robmerrell/gist:252627
Created December 10, 2009 11:18
Show Gist options
  • Save millisami/253281 to your computer and use it in GitHub Desktop.
Save millisami/253281 to your computer and use it in GitHub Desktop.
# Put this in config/initializers/date_time_format.rb
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:short => lambda { |time| time.strftime("%b #{time.day.ordinalize}, %Y - %H:%M") }
)
# To use this time format do:
DateTime.now.to_s(:short)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment