Skip to content

Instantly share code, notes, and snippets.

@zackfern
Created April 1, 2024 00:39
Show Gist options
  • Save zackfern/4b05abc05beca9f6ae6c8b802f656514 to your computer and use it in GitHub Desktop.
Save zackfern/4b05abc05beca9f6ae6c8b802f656514 to your computer and use it in GitHub Desktop.
Some date formats I regularly find myself using in my Rails projects
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