Peter Hajas

RSS

Notes

ISO 8601 - The Superior Date Format

I really like ISO 8601. When I was in school, we learned the MM/DD/YYYY date formatting scheme:

04/03/2024

This is a strange choice. It’s written out of order in terms of the size of each date component (medium, small, large). The DD/MM/YYYY system is slightly better:

03/04/2024

Unfortunately, it’s confusing with the MM/DD/YYYY system (is that April 3rd, or March 4th?) and in the wrong order (it goes small, medium, large). And what’s with the slashes?

ISO 8601 solves all this. An ISO 8601 date looks like this:

2024-04-03

There’s no ambiguity here. It’s large, medium, small. There are no pesky slashes to mess with your file naming scheme. You can alphabetically sort a list of them trivially to order ascending or descending, too.