Why CCYY-MM-DD is the Best Date Format

Date formats are not something that many people have any sort of opinion on, but it is something that I find very polarizing and I’ll explain why.

The two date formats that I probably see most often are MM-DD-(CC)YY and DD-MM-(CC)YY, with the former being more prominent in the United States and the latter seeming to be the preferred format of European countries and elsewhere in the world. Maybe it aligns with use of the Metric system versus Imperial units, I’m not really certain. Either way, I think both options are terrible.

First and foremost, they are terribly ambiguous. Without a definite indicator or a value higher than 12, the month and date could be interchangeable. Take today’s date, for example. September 12, 2018 as I will list it formally, could be represented as 09-12-2018 or 12-09-2018. Let’s not even get into the option of excluding the century from the year, as we all know of the headache that caused with Y2K. Without a clear context, those dates could alternatively be December 9, 2018.

Fortunately, with dates past the 12th of the month, it is more obvious. My birthday, for example, is most frequently represented as 06-13-1991. Even if I were to write it as 13-06-1991, there is not a 13th month. Between those two options, I credit DD-MM-CCYY with being in order of significance. Days are smaller than months, which are smaller than years. Still, it can cause issues when representing dates before the 13th, when there is not some indicator of what format the date is shown in.

Some people express disbelief that I would put the year at the beginning of a date. Admittedly, it is not frequently used outside computing systems. In written representation, most sources will either put month or date at the beginning, and year is almost always at the end. Some of the more explicit sources will write out the month as a word, which has benefits and drawbacks. Reading “September” is more obvious than seeing a 09 in the first or second spot of a numerical date. However, words don’t sort very well for arranging things by date. The months of the year, when sorted alphabetically, are all out of order. April, August, December, February, January, July, June, March, May, November, October, September. Just seeing them represented like that seems foreign, and almost repulsive.

Which brings me to why CCYY-MM-DD is the best date format. First and foremost, it is inherently unambiguous. I have never seen CCYY-DD-MM, and can’t imagine why anyone ever would. If a source leads with the year, the format definitely follows with month and date in that order. But additionally, dates in this format sort alphanumerically the same as chronologically. Especially since the century is always included, there will not be a date until the year 10000 that has a date out of order. And in the next 8,000 years, I would assume we will have come up with a better option. The year 1991 will come before 2018, where 91 would come after 18. There is no need to add fancy filters into your file explorer or other cataloging system. Sorting by name or title, when using this date format, will always be chronological.

Admittedly, seeing this date format for the first time can be jarring. My first exposure to it was when I was tasked with adopting a customer’s data from another system for import into my own employer’s software. I saw the date format, and I was so confused as to why someone would save dates in such a strange way. However, when I once sorted the data by that column accidentally, it was obvious why someone would use that format. The entire file was sorted by chronological order of the dates, despite being a simple text field. With date or month first, that would have been impossible.

While I understand that having people universally switch to CCYY-MM-DD would be nearly impossible, I do believe it is the better format. We still haven’t managed to get the United States onto Metric units, and that makes math so much easier. Plus, seeing triple digits on my speedometer makes me feel like I’m going really fast, even though I’m only doing a little over 60. But if we do eventually have the majority of the US switched over to metric, I think dates are the next thing we should address. The computer scientist in your life will thank you.

Comments