Skip to content

Instantly share code, notes, and snippets.

@budparr
Last active February 1, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save budparr/0e0a40e7a24c078e7267ab9c5b23c922 to your computer and use it in GitHub Desktop.
Save budparr/0e0a40e7a24c078e7267ab9c5b23c922 to your computer and use it in GitHub Desktop.
Hugo date formatting
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