A Sensible Date Format

Why do I use a strange-looking date format like

or (when more details needed)
1996.Feb.29 (Thu) 16:45:23.7
? This format is actually quite consistent: the units of time start from large units (years), and decrease as you read to the right -- which is already how “Feb. 29” and “16:45” work. To complete the picture, the amount of prefix and suffix you include simply depends on the amount of context and precision (resp.) you need:

Comparing to other alternatives

The european date format -- which reverses the order of the day/month/year -- is justifiable, since it allows the reader's eye to quickly pick out the day-of-month (which is what people are probably most interested in) while still specifying the month and year. The American date format of “month/day/year, hour:minute:second am|pm”, tries to mimic speech patterns (which is a slightly different mode of thought), but in practice this just ends up hopelessly muddling everything.

Spelling the day-of-week

Regardless of the particular format you choose, I've found that taking the extra half-second to write the month as a three-letter abbreviation, rather than the number, practically always makes my message clearer. Compare “1996.10.17” with “1996.Oct.17”, or “11-9-2001” with “11-Sep-2001”. Smart software will be able to parse the full form, no problem.
Some possible exceptions:

How to get your PDA, website, etc. to use this format

Many programming environments follow POSIX's strftime format. The format string I like best is

%Y.%b.%d (%a), %H:%M:%S
for Year.month.day (weekday), hour:min:sec. To include a time-zone append %Z to this format string; for a 2-digit year use %y instead of %Y.

Feel free to send me other directions -- e.g. for linux's bash, for Windows, etc.

Midnight Confusion

“The deadline is midnight Wednesday”.
Does this mean Wednesday 0:00 (coming just after Tuesday 23:59), or is it Wednesday evening (technically, Thursday 0:00am, and no longer really Wednesday)?

By the way, if you want to make it clear you're using a 24-hour clock, it's not always enough to use a leading zero (e.g. 08:30), since times in the range [11:00,13:00) are still ambiguous. You can consider using `h' as a divider rather than `:', to get 8h30, 11h30, 13h00.

Other reasons

Here is another call for a sensible date format.

While overall it makes many good points, it does suffer from one incorrect argument, saying that we humans should use dates which are easy for computers to read and compare and sort. That's backwards -- we should not change our mode of thought just to make our tools easier to use; good tools are made to work for us. Elementary software practice means having a library function which to parse whatever (unambiguous) date format humans use; the programmer calls that library function as needed, rather than always rewriting code for this task. ...But otherwise, the arguments about reducing human confusion are right on the money!

Ian's Home Page Please let me know
of any suggestions.
Last modified 2017.Jan.13.