Use International Date Formats

Mar 18 2008

Internationalization of software is always difficult. The linguistic and cultural differences around the globe adds to the problem. I think that the the simplest thing to sort out is the date representation. As with any other different countries denote dates differently.

Karl Dubost says it best in the W3C website:

The worst potential usability problems come when the date is written only with numbers as in the following example, because the date’s interpretation will be different from one country to another.

Imagine the following date: 02/04/03

Which does it mean?

  1. 2nd of April 2003 (European style)
  2. 4th of February 2003 (USA style)
  3. 3rd of April 2002

Your answer will depend, mostly, on which country you live in.

To address these problems, the ISO defined a new international date format (ISO 8601). In this standard, the dates are formatted as: YYYY-MM-DD

For example, “3rd of April 2002″ becomes 2002-04-03 in this international format. This format also supports precise date and time, with timezone information.

The main advantage of this scheme is that it causes the least confusion. If we were to denote a date as 02/04/03, there would be confusion about whether the date is in the format DD-MM-YYYY or MM-DD-YYYY. Since the ISO standard starts with YYYY, it is pretty obvious that MM-DD follows. (Nobody uses the YYYY-DD-MM format. See the wikipedia entry)

Another major feature is that when dates in this format are ordered sequentially by the leading number, this also orders them in date order. So a simple sort of th string produces the dates also in sorted order. This was not possible using the MM-DD-YYYY or DD-MM-YYYY formats. Sorting dates needed a thinking programmer then.

Other advantages according to the ISO specification are:

  • Easily readable and writeable by systems
  • Easily comparable
  • Language independent
  • Larger units are written in front of smaller units
  • For most representations the notation is short and of constant length

So use the ISO date format in your programs and web apps. It greatly enhances the usability of your applications and helps in addressing the needs of a more global community.

6 responses so far

  • Binny V A says:

    Sure, its the better format – but the problem is that its not user friendly.

  • Silky says:

    I almost exclusively use dd-MMM-yyyy (1-Jan-2008). I know it doesn’t support different languages, because in japan it is not “Jan”, but it definitely my preferred method when dealing with databases and unknown systems.

    To be honest I would prefer this scheme (dd-MMM-yyyy) to be adopted in some fashion (words instead of numbers) because no matter _WHICH_ way you format numbers, some programmer can screw it up. Better to have a word translation or just force even non-english speaking countries to process dates in that fashion. Not exactly politically correct, but at least it will provide functional correctness _and_ readability.

  • Niyaz PK says:

    Binny,
    Once everyone starts using it, we will get used to it. It is better than using the multitude of formats which are not user friendly either.
    Silky,
    Every single person has his/her personal preferences. That is why the ISO standard is needed to standardize the date formats.

  • S.K says:

    Hi,

    I am glad you’ve mentioned this.

    I have been a proponent of this standard and have been using this format on my blog for the last 4 years!

    I have also blogged about this here:

    http://cyberbrahma.com/2004/01/13/iso8601-date-format/

    Cheers!

    S.K

  • Niyaz PK says:

    S.K,
    Good that you are using the format in your blog.
    By the way, I have not started using the format here.
    I should work on the theme when I get time.
    Thanks for coming by.

Leave a Reply