Wednesday, 27 February 2013

How to write the date

We write numbers with the most signifcant parts on the left, even in languages that write right-to-left (I think), so, for example, the number 123 has the hundreds left (100) then the tens (20) and then the units (3). So writing dates in the same order makes sense with year, then month, then date. One could, perhaps, argue that people say "27th February, 2013" and so you should write it that way around, but people are inconsistent, e.g. "February 27th, 2013", and so on. Also, people say "Half past 2" but we know to write times logically as HH:MM:SS.

There are lots of good reasons to write dates and times with leading zeros as it makes them the same size and line up and so on, so using 02 for Feburary not 2. 2013-2-27 would be messy. It also breaks the following point...

Using dates in this format you can sort dates alphabetically and get date order. Putting time HH:MM:SS on the right means you can sort date/times.

This is the format used by SQL

Y2K has taught us to put a year in full is way better

Putting a year in full means you know which of the three fields is the year and so immediately know this is not either the "UK" format (DD/MM/YY) or the "US" format (MM/DD/YY) and so avoid any confusion - it has to be ISO format as nobody does YYYY-DD-MM (not even in one of Randall's examples).

I remember starting to write dates in this format when I was at uni, as it was an "international standard". I confused people by writing dates like that on cheques. But that was a few years before 1988, which probably means my memory is faulty.

6 comments:

Japan, and I think Quebec, used YY-MM-DD - not good when you've dates in more than one century to worry about, but otherwise, that was good, and we used to use YYMMDD a lot in databases at school - this advice changed to "YYYYMMDD when it needs to be a number, YYYY-MM-DD where text" by the time I took GCSEs. I agree, it is the truly sensible format.

I will do YYYY-MM-DD for dates for myself but if I am doing dates for humans (and dyslexics who can mix up numbers) I'll use something more longform like DD-MMM-YYYY e.g 27-FEB-2013. For me it's a mix of "what is technically right" + accessibility. Same reason I don't use 24hr clock at work or for accessible publications because many dyslexic students of ours get horribly confused.

While I prefer to use YYYY-MM-DD and 24hr clock for myself I have learned that many dyslexic people will transpose numbers so this format can be confusing. So at work I'll often use DD-MMM-YYYY like 27-FEB-2013 and 12hr clock 1pm, 1:15pm etc cos accessibility does override "being right" as it were.