Last active
February 1, 2017 14:44
-
-
Save budparr/0e0a40e7a24c078e7267ab9c5b23c922 to your computer and use it in GitHub Desktop.
Hugo date formatting
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
Go's reference time for layouts is: | |
Mon Jan 2 15:04:05 MST 2006 | |
which can also be expressed as: | |
01/02 03:04:05PM '06 -0700 | |
For more information: http://golang.org/pkg/time/#pkg-constants535 | |
By picking a default date, there is less parsing that needs to happen, plus they chose a date that shows definitively how to handle things like leading zeroes, day/month ordering and other edge cases that aren't discernible from all dates. | |
http://fuckinggodateformat.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment