Created
April 1, 2024 00:39
-
-
Save zackfern/4b05abc05beca9f6ae6c8b802f656514 to your computer and use it in GitHub Desktop.
Some date formats I regularly find myself using in my Rails projects
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[:ymd] = "%F" # 2023-01-01 | |
Time::DATE_FORMATS[:mdy] = "%D" # 01/01/23 | |
Time::DATE_FORMATS[:human] = "%B %d, %Y" # January 01, 2023 | |
Time::DATE_FORMATS[:time_12] = "%I:%M %p" # 01:30 PM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment