ANSI/ISO Date Format
With the new millennium rapidly approaching and everybody becoming aware of the need to represent dates unambiguously, I thought I'd make the switch to denoting dates with the ANSI/ISO standard format, "YYYY-MM-DD".
My aversion to the conventional "6/3/89" type of thing is threefold:
- It is unclear which year is being referred to. Does it mean 1989, 1889, 2089, ...?
- It is ambiguous which day and month are represented. In some parts of the world, it means "the 6th of March", elsewhere "the 3rd of June".
- When sorted alphanumerically, these dates do not fall into chronological order.
The ANSI/ISO standard date format (say, "1989-03-06") does not suffer from these problems, because:
- Years are represented using 4 digits (though I'm not certain if the standard allows more for years after 9999 - has the term "Y10K" been termed yet?),
- Day and month numbers are unambiguous, because no other (common?) date format begins with the year field,
- ANSI dates sort into chronological order even when treated alphanumerically, because they are "big-endian" and each field is zero-padded and fixed-width.
It seems I'm not the only one with these general opinions: there's a more detailed description of date standardisation by Markus Kuhn that's well worth a look.
Questions, comments or complaints? Send me an e-mail!
(E-mail address munged for anti-spam effect; just delete the ".nospam")
This document last modified and © 1999-07-11
This page has been accessed
times, apparently.