4 ms·
Honestly I constantly see dates argued about and people state various formats that are still confusing. 4-2-2 of any variety can be confused. Why not 2-3-4 or 4
by CobaltFire 5y ago
Honestly I constantly see dates argued about and people state various formats that are still confusing. 4-2-2 of any variety can be confused. Why not 2-3-4 or 4-3-2 (DD-MMM-YYYY or YYYY-MMM-DD)? I’ve never understood why that isn’t more widely used.
- deleted 5y ago[deleted]
- qayxc 5y agoWhat would MMM look like? 02-005-2022? Usually MMM refers to the 3-letter shorthand of the month, e.g. "APR" or "OCT", but I guess that's not what you meant because it couldn't be used internationally.
- CobaltFire 5y agoI do mean with the letters, but international issues makes sense. I should know better but just never thought about it.
- qwerty456127 5y ago> Why not ... DD-MMM-YYYY Because sorting. You can just sort a collection of dates stored as YYYY-MM-DD strings alphabetically and the result will always be in accordance with the actual time line.
- CobaltFire 5y agoThis is the answer I needed. Thanks!
- kstrauser 5y agoThis has so many happy side effects. Yesterday I was upgrading some code to use a newer version of an API. The old version stored timestamps as int seconds-since-epoch, but the new one stored them as ISO8601 strings. I replaced a line of code like: if row['timestamp'] < cutoff_time_as_int: ... with: if row['isotimestamp'] < cutoff_time_as_string: ... and everything kept working exactly as before. There was no expensive and error prone date parsing involved, some some simple string comparison. It wasn't quite as cheap as comparing ints, but it's not performance critical code so eh, good enough.
- pwinnski 5y agoYYYY-MM-DD with numeric months sorts in order. Nothing else does.
- mr_toad 5y agoIf someone gives you a date like 10–04-2021 you need to know whether they’re American or not. Because it could be October 4th, or April 10th. (In theory people could write yyyy-dd-mm, but I’ve never seen anyone actually do that).