Skip to content

Instantly share code, notes, and snippets.

@marsz
Created May 22, 2013 07:27
Show Gist options
  • Save marsz/5625833 to your computer and use it in GitHub Desktop.
Save marsz/5625833 to your computer and use it in GitHub Desktop.
# config/application.rb
module MyApp
class Application < Rails::Application
...
Time::DATE_FORMATS.merge!(:default => "%Y-%m-%d %H:%M", :ymd => "%Y-%m-%d", :md => "%m/%d", :week_day => "%u")
...
end
end
User.last.created_at.to_s(:ymd)
Time.now.to_s(:week_day)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment