3 ms·
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
by mrweasel 12y ago
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/strftime.html 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/strftime.3?query=strftime&sec=3 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.
- dmourati 12y ago* 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.