|Academic Computing and Communications Center|
The Right Format for Dates
The right format for dates in data -- and in the real world -- is one
that is totally unambiguous.
Other dates do not fare as well -- the 12th or earlier day of any month, for instance, or any date after January 2, 2001 -- 01/02/01. Or is that February 1, 1001? (We're good for "which one is the year?" in the year 2000, because 00 has to be a year. And January 1, 2001 is totally OK; it's 01/01/01 in all three forms.)
Writing a four-digit year will at least tell you which of the three numbers is the year. But we're still left the other problem, which is more important globally: Is 02/01/2001 February 1, 2001 or January 2, 2001? What to do?
All the way back in 1988, the International Organization for Standardization decided, for obvious reasons, that these country-specific all-numeric date formats had to go. The ISO standard date format is defined in ISO 8601: yyyy-mm-dd
This form has a number of good features. It has a four-digit year, it is unambiguous, and it can easily be sorted by a computer. And since nobody was using it before, it avoids favoring the traditions of any one country over another.
In written text, the traditional written forms of a date are also unambiguous,
because a four-digit year is used and the month name is written as a word
rather then a number. In English, we have the American form, June 23, 1998,
and the British form, 23 June 1998. Regardless of the order, you can tell
that the four-digit item is the year, the word is the month, and the two-digit
item is the day. However, these literate forms should be avoided in any
data processing use, because data is generally language-free and because
dates in these formats cannot be sorted without conversion.
This and other ISO 860-related links are in the ACCC document The Right Format For Dates, along discussions on how dates are stored internally in SAS, SPSS, and several programming languages, and instructions on writing dates in the ISO 8601 format with each package/language.
|The A3C Connection, July/Aug/Sept 1998||Previous: The ACCC Y2K Plan||Next: ACCC Free Seminars, Fall '98|