Skip to content

Comment on Go Date Formatparent

Comments

By contrast, as soon as I learned the "trick" http://golang.org/pkg/time/#pkg-constants

Since MST is GMT-0700, the reference time can be thought of as 01/02 03:04:05PM '06 -0700

Such sadness. Using a reversed month/year date as a "reference" when we have ISO 8601. Much american-centrism.

Otherwise I like the trick, but I'm not sure it scales to locale-specific time formats (whereas strftime does a bit with %aAbBxX).

I tend to prefer ISO-style dates/times myself... and unless the date+time is tied to a location+event (and not always then), store/transmit as UTC. This leads to far fewer headaches in the long run.

The line right above that one is the first cited reference format:

    Mon Jan 2 15:04:05 MST 2006

I know, I'm talking about the mnemonic used to remember this date.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.