Writing numeric dates…

Numeric dates can be a pain. Look at it: in France, today is 27 février 2013, which turns to 27/02/2013. In the United States, it is February 27th, 2013, which gives 02/27/2013. Sometimes, you do not know which format you are reading: is 02/03/2013 February 3rd or March 2nd?

Well, I discovered only today there is a global ISO standard for writing numeric dates:

XKCD - ISO 8601
XKCD – ISO 8601

This is the format I thought was the most logical when I looked for one at the beginning of my programming learning. As for a number, you go for the most rough value, and you gradually become more precise. You first write the largest unit (the year, or the hour in the case of time), and you go step by step to smaller units (month/minutes, then days/seconds, then time/fractions of seconds).

This is so logical. I mean, we already do it for time everywhere, or even decimal numbers, why is it not applied to dates?

Plus, have you ever tried to sort dates saved as strings? With this format, you can just sort them alphabetically. It is quite convenient, is it not?

For more information about the rules for writing date and time according to the ISO 8601, I suggest you take a look at the corresponding wiki page.