3 ms·
Unix date command: Use +%Y instead of +%G Java: Use yyyy instead of YYYY Python: Use %Y (ISO-8601 year number is not available) PHP: Use Y instead of o P
by claar 12y ago
Unix date command: Use +%Y instead of +%G
Java: Use yyyy instead of YYYY
Python: Use %Y (ISO-8601 year number is not available)
PHP: Use Y instead of o
Please contribute other languages in replies and I will add them.
(edit: This post had originally suggested the post's title be changed to mention Java, thus vitno's reply below)
- vitno 12y agoalthough this post references Java, this doesn't just affect java. This affects anything that uses ISO 8601.
- hobbified 12y agoAnything at all with strftime: Use %Y instead of %G. It's a C function, but many languages (Perl/Python/Ruby/etc.) expose it through their own datetime libraries.
- bbcbasic 12y ago.NET: Use yyyy (ISO-8601 year number is not available)