Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://twitter.com/jmhodges/status/549430032616017921

Also https://twitter.com/jmhodges/status/549431554879938560 :

"(The correct formats are "yyyy" and "%Y". Yes, this matters and is happening right now. "Week-based years" are a thing.)"



Not much of a source really, it's just some random dudes tweet, with no real explanation. Also it assume (correctly in most case) that %G or YYYY isn't what you where looking for.

If you're going to throw something like this out on the internet, I would like it to be more detailed. Just blasting it out on Twitter is pretty useless.

Reproduction: `date -u "+%G"`, sorry but that does EXACTLY what it's suppose to: [http://pubs.opengroup.org/onlinepubs/009695399/functions/str...].

Depending on your operating system it's even documented. OpenBSD has a pretty good documentation for it, while Mac OS X is somewhat lacking, but to the point where you wouldn't use it without checking what it actually means.[http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/...]

Why would you even pick %G if that wasn't what you meant, %Y seems more obvious. Using YYYY I can understand, it's a bit of gotcha that YYYY is one thing and yyyy is something less. It even test correctly more often than not.


* Random dude who worked at twitter and cited the people currently working at twitter who found and fixed the problem during the time he tweeted it.


thanks :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: