Tuesday, February 15, 2011

How to Properly Format Dates

Summary: The purpose of this article is to examine how dates are displayed on the web and to provide people with a usable format to follow. The recommendation that is provided is general and not limited to web pages.

I've been bothered about dates and date formats on web pages for a long time. I've been suffering and it is time to break the silence.
 
I'm extremely active on the web. If you are reading this article, my guess is that you are active too. We don't have time to mess around and we don't want ambiguity. When you go to a web page, particularly a news or current events page, it is important to know that what you are reading is fresh. The value of news goes down rapidly. If you are a blogger, you know exactly what I am talking about.

In addition to freshness, dates are important if you are comparing information. For example, do you want to get old medical information or new medical information? In some cases, months matter, and even days can matter.

In short, dates matter because they help people understand the context of what we are reading. They give people reference points. When it comes to information consumption, humans tend to like certainty. When dates are displayed on web pages they are like warm blankets because they make us comfortable.

How Are Dates Used?

The most common date is no date at all. Don't laugh. Most web pages, including most news pages and current event pages, don't have any dates. Verdict: This is insane.
 
It is also common to see today's date, which acts something like a clock. The date you see on the web page is always today's date. This is fine on some web pages where you want to know today's date, perhaps on a major news web site, but generally this is a silly idea. Do you really need to see today's date on most web pages? Is there really value? Furthermore, can you tell that the date you see is actually today's date? Generally, you do not need to see today's date, it doesn't add value, and you can't tell that the date you see is today's date versus some other date. Verdict: Usually a bad idea and confusing.

Sometimes, if you are lucky, you will see date of publication. If you are really lucky, you will see last updated date. If you are lucky beyond lucky, you will see date of publication and last updated date, if the page was updated. In general, these are the dates we care about. They provide us with an indication of freshness and relevance. Include date of publication and last updated date when relevant. Verdict: Very good or great idea.

There are other dates too, like the date when something is available (future publication or release date), expiration dates, date the last time something was viewed or selected, and so forth. These conditional dates can be quite useful in the right context. Verdict: Conditional dates can add a lot of value to a web page when used strategically. 

Types of Dates and Date Formatting on the Web

Below I am going to show you how dates can be formatted on the web. I'll go in order from worst to best and at the end of this section, you'll have my recommendation for the best date format. 
The first date format is the one I see the most often. Ironically, it is the one used most often. 

FORMAT:  7/8/04 or 7.8.04 or 7-8-04 

It is bad because it confuses people around the world. Is it the 8th of July or the 7th of August? Other than your own knowledge and preference, it is completely ambiguous. Another issue is that it doesn't include the full year (2004) which can be confusing to some people. One good thing about this format is that is doesn't eat up too much space. However, it is rare that space is an issue.

The  second format is very much like the first. It is also used very often.
 
FORMAT: 7/8/2004  or  7.8.2004  or  7-8-2004 

This format is bad for nearly all the reasons mentioned above. It is improved by adding the rest of the year information so it reduces ambiguity, but it is slightly longer.

The third format brings in actual words, which most people like. The information is easier to digest.

FORMAT: July 8, 2004  or  July 8th, 2004

The major benefit is readability, but the major downfall is length. This isn't an issue very often, but sometimes it is. Another small issue with this format is the comma. That can cause formatting problems, such as line breaks at the wrong times.

The fourth format is quite good, but it doesn't look quite right and I've only seen it used a few times.

FORMAT: 8 July 2004  or  8 Jul 2004

The spaces look kind of funny and I've also seen formatting issues because nothing forces the entire date to stay together so it might wrap to the next line. One good thing is that the order is logical from smallest to largest. Day, then month, then year. That makes a lot of sense to users around the world.

The fifth format is the one that I like the best

FORMAT: 8-July-2004 or 8-Jul-2004

The date is short, easy to read, logically ordered, accepted globally, and it will stay together if formatting pushes it to the next line. It is reasonably short, but I admit it could be shorter, but not by much. It could also look a bit less mechanical, but I don't feel that is a problem. I've literally never had any usability complaints about this date format and I've never seen any research against it. In most cases, it just works. 

Useful Notes About Date Labels
It almost always makes sense to add a label to a date. If you publish or create something, and you have the room, add a label. Here is an example:

Created: 29-July-2004

If an event occurs that users should know about, such as a revision to something published, add that too. I suggest keeping the original date with the original label, then adding the other label and date. This gives users a trail to follow, and it indicates freshness of the material at the same time. It indicates also that it is a living document, open for growth. Here is an example:

Created: 15-July-2004
Last Updated: 29-July-2004


In almost all cases it makes sense to place date information at the top of the page. The bottom can also work, but the top is the best. It sticks with the convention used by printed materials, such as newspapers and magazines. Placing this information in the middle of the material or halfway down on the sides just doesn't make sense.

Caveats
The date formatting advice presented above doesn't really apply to forms. Virtually no forms I have seen use the format outlined above. Your best bet to increase the usability of dates on forms is to use proper labels. This is a topic worthy of its own article. 
Some pages don't require dates. For example, many web applications simply don't require dates. Don't get the idea that all web pages should have dates posted, just most of them.
As far as I know, my recommended date format causes no issues in Europe or Asia, or the rest of the world for that matter. However, perhaps my format confuses people in far off places. If I am an ethnocentric date snob, I apologize.

If you want to just post a month and year without a day, then using something like "July 2004" would work just fine. You can safely ignore my recommendations.

You might be surprised but my recommendation goes against the ISO date recommendation, which is backed by the W3C in this case. They say that 8-July-2004 should be written 2004-07-08 but I think that is poor for humans for the reasons described above. Humans aren't machines and they won't always parse 2004-07-08 correctly. In fact, I think it would confuse most people.
I am assuming that almost all readers care about the Gregorian calendar. Non-Gregorian dates and calendars, often used in religious circles, are not covered by my recommendations, although the usability principles probably still apply.

No comments: