Edwards family web pages:Chris/Computing/Date Formats

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:

  1. It is unclear which year is being referred to. Does it mean 1989, 1889, 2089, ...?
  2. 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".
  3. 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:

  1. 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?),
  2. Day and month numbers are unambiguous, because no other (common?) date format begins with the year field,
  3. 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.