Last active
February 1, 2019 17:05
-
-
Save rmm5t/2078da1c89fe925d4391bba6cf7c1696 to your computer and use it in GitHub Desktop.
Example of config/initializers/date_time_formats.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Time::DATE_FORMATS[:long_date] = Date::DATE_FORMATS[:long_date] = "%b %e, %Y" | |
Time::DATE_FORMATS[:day] = Date::DATE_FORMATS[:day] = "%a, %e %b %Y" | |
Time::DATE_FORMATS[:local_time] = Date::DATE_FORMATS[:local_time] = "%I:%M%P %Z" | |
Time::DATE_FORMATS[:human] = Date::DATE_FORMATS[:human] = lambda { |t| t.strftime("%b %e, %Y %I:%M%P").sub(/0(\d):/, '\1:') } # Oct 2, 2011 5:57pm | |
Time::DATE_FORMATS[:rfc822] = "%e %b %Y" # Already in Date::DATE_FORMATS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment