Monday, January 21, 2013

A Rant about Dates

I found a misfiled receipt in the folder hanging next to my tax folder. It might have been there for a while – I’m not sure. I’m no fan of overpaying my taxes, so I looked for the transaction date to see if it’s from 2012 and I can use it in my next tax filing, or if I messed up on a previous year’s tax filing. A few seconds of scanning revealed

11/01/12

Seriously? Somebody thinks this string of characters conveys useful information. Or maybe this person just hates other people.

There are 6 possible ways to reorder the year, month, and day in a date. Fortunately, 3 of these orders are not in widespread use. The ones that are widely used are

year-month-day
day-month-year
month-day-year

So the plausible dates for my receipt are

2011 January 12
11 January 2012
November 1, 2012

So, either I messed up my 2011 taxes and can file an adjustment request, or I can use this receipt on my 2012 taxes. Great. Maybe I’ll try to invent some parallel-universe technology, try both approaches, and see how it all works out.

I know there are people who have strong opinions on the “correct” order for the year, month, and day. I care much more about clarity than some idealistic argument for the correct order. That said, here’s my pitch for year-month-day. We have a well-established standard for hours, minutes, and seconds. It goes from biggest (hours) to smallest (seconds). So, I like the following format going from years all the way down to seconds.

YYYY/MM/DD HH:MM:SS

Yes, yes, I know I used “MM” twice. But you know what I mean.

Let me repeat that while I like this format, I could live with just about anything that is clear. And by clear, I don’t mean a format that is unambiguous to a computer; I’m not trying to solve the upcoming year 2100 or year 10,000 problem. I want a person who knows the commonly-used date formats to be able to look at a date and read it unambiguously.

A starting point that helps a great deal is to use 4 digits for the year. I know this takes extra space, but there seems to be space on my receipt for 4 lines of text begging me to enter some idiotic contest. I could win cash prizes and all I have to do is give them a name, email address, phone number, and implicitly agree to endless email and phone spam.

When we use 4 digits for the year, the only possible ambiguity is with the month and day. We can resolve this using letters for the month. All of the following are quite clear.

2011 Jan. 12
11 Jan. 2012
Nov. 1, 2012

However, writing letters for the month and a 2-digit year is not good enough: 11 Jan. 12 is not clear. If someone insists on using numbers for the month, then the only order that is unambiguous is

YYYY/MM/DD

Many people don’t like this format. They are used to Nov. 1, 2012 or 11 Jan. 2012. That’s fine. Use one of these if you like. But unless you hate people, use 4 digits for the year and write letters for the month. Otherwise you’re making baby Jesus cry.

13 comments:

  1. I've recently come to appreciate YYYY-MM-DD when used as a filename prefix on electronic bills that I download. I like to put the statement date or due date in the bill filename. If you use the YYYY-MM-DD prefix, then the bills will be sorted correctly.

    ReplyDelete
  2. Does this mean I have to write a post about complicated math and investing? Stay on your side of the financial Blogosphere!!

    The Baby Jesus comment was a nice touch though.

    ReplyDelete
  3. agreed. iso all the way

    ReplyDelete
  4. I have been doing it for years.
    And, yes, it's about money: order in papers is one of the important components of the peace of mind about money.

    ReplyDelete
  5. Sorry to hear about the headache.

    I believe there is no one 'right' way for some things in life, that includes date formats. These things have a context or reference.

    I totally agree with you, what is critical is clarity on the date format being used.

    I'm a fan of month , date <##>, and year <####> but your point about yyyy/mm/dd is great.

    Baby Jesus cry...that's funny.

    ReplyDelete
  6. As a kid it bothered me for some reason that the two-letter month abbreviation "JN" could be January or June, and "MA" could be March or May, so I set out to create a totally unambiguous set of abbreviations. I gave up when I discovered that the only unambiguous abbreviation for June would be JE, and I considered it too weird that the distinguishing letter in that abbreviation was silent.

    ReplyDelete
  7. @Anonymous #1: I use that file name prefix as well to keep files sorted chronologically. It works well for me. No doubt many people do this.

    @Big Cajun Man: Glad you liked the "baby Jesus" bit.

    @Anonymous #2: Hmmmm. ISO. I didn't think about that. Maybe this whole date thing with the year first is a plot to take away our guns :-)

    @AnatoliN: I certainly need to keep financial papers (and computer files) organized to have peace of mind about money.

    @Mark: I don't mind if people use MMM-DD-YYYY, as long as they use letters for the month.

    @Patrick: Your attempt at compression reminds me of some of my father's codes. He was a programmer way back in the days of tapes. (He once told me a story of going down to some workers and asking for a favour: please wind me some more memory.) He would use his codes on everything. One example was marking containers of food in the freezer. A 3-letter code indicated month, year, and contents. Unfortunately, the rest of us could never decode it, and he could only decode it about half the time himself. I'm happy to hear that you abandoned your effort due to a lack of decoding clarity.

    ReplyDelete
  8. At least new we don't have to mistake the two digit year for the month. Only 19 more years and we won't mistake the year for the day of the month either, just like back in the '90s. Then three letter months will again be unambiguous.

    I like ISO format for things I want to sort automatically, but when reading or write a date I like it how I would say it - month -> day of month -> year.

    ReplyDelete
    Replies
    1. @Greg: I agree that by 2032, a two-digit year won't be confused for the day, as in 30 Aug. 32. However, we don't always refer to the present year. We can imagine a document referring to 23 Aug. 32 and on another page referring to a year earlier (30 Aug. 31). Now the poor reader has to dig around for the other date and hope you've been consistent. So, I think it's safest to just go with 4-digits years.

      Delete
  9. I had a similar experience with my son’s teacher telling us his book reports were due biweekly. Does the latter word mean twice a week or a fortnight? So I looked it up in the dictionary. It appears the confusion is pervasive within English-speaking countries - and the dictionaries handle it by providing both definitions.

    http://www.merriam-webster.com/dictionary/biweekly
    BIWEEKLY
    1 occurring twice a week
    2 occurring every two weeks: fortnightly

    http://oxforddictionaries.com/definition/english/biweekly
    Definition of biweekly
    - appearing or taking place every two weeks or twice a week:

    ReplyDelete
    Replies
    1. @Larry: Perhaps you've stumbled onto the source of marriage conflict: both men and women expect sex to be biweekly :-)

      Delete
  10. Another place this dating stuff gets annoying is on canned goods. They stamp a best before date on them, but if the number is just a straight run of 6 digits it's pretty much anyone's guess what it means. What it means for me is I won't buy it or eat it....

    ReplyDelete
    Replies
    1. @BetCrooks: I've run into that problem before as well. It's usually something like wondering if the food expires Jan. 2 or Feb. 1. But it can involve uncertainty about the year as well.

      Delete