3 ms·
> 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
by 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.