Skip to content


Date Formats

Display dates in any way your users want. I don’t care.

Edit dates in forms, the way that best suits your users, but make sure the format is clear.

Under-the-hood however there are NO EXCUSES. Acceptable date formats are

  • YYYY-MM-DD
  • YYYY-MM-DD HH:MM:SS
  • YYYY-MM-DDTHH:MM:SSZ (ISOtastic!)
  • seconds since 1970 (UNIX time)

At a push you could store timezones, but UTC is better.

If you ever use MM/DD/YYYY in a machine-readable file we will send the data-format ninjas to destroy your entire civilisation. (I’m looking at you, U.S.A.)

Actually if you’re writing a page for a global audience, make it clear. The best human format is with a month as 3 letters, so you can’t be confused about which bit is which. Some sodding sites have forced me to hunt through other pages to find a date where d>12 just to figure out which way around they are.

A good tip is also to put the day of the week in. In short term dates, people think in terms of next Wednesday, and if you don’t then they’ll be force to convert in their heads. Another benefit is that it catches typos as people see the resultant page and go “Hey, that says our meeting is on a Sunday…. oops did I say July? I meant June!”

I like putting in little ths on my dates but our communication manager keeps making me take them out again. It’s not a big deal, but I’m going to use one right now to cheer myself up.

Christopher Gutteridge, Saturday, 7th November, 2009.

Posted in Uncategorized.


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Christopher Gutteridge says

    Oh, yeah, and if you put YYYY-MM-DD in filenames, they sort in a sane way!

  2. Daniel Alexander Smith says

    I used to also think as your post suggests that only the third of your examples was the ISO8601 date example, but have recently discovered that actually each of the first three examples are all ISO8601 compliant dates 🙂

    In other words, I agree with your sentiment, and that we can all agree that we shoudl use some string that can be parsed as ISO8601.

  3. Christopher Gutteridge says

    I like the ..T…Z format because you can tell at a glance that it’s the ISO format. Nobody would use something which looked “a bit like it” by accident.

    Now we’ve got dates with most-significant-first, it’s a pity we can’t do URLs too:
    http://uk.ac.soton.ecs.www/people/cjg

    That ship sadly, has sailed.



Some HTML is OK

or, reply to this post via trackback.