back

by toddmorey·2y ago·view on hn ↗
This is good guidance except they get the date format wrong.

(Teasing. I’ve always thought the US MM/DD/YYYY format makes absolutely no sense. Why don’t the units go small, bigger, biggest? Why do we continue to put up with that?)

7 comments
DD/MM/YYYY also makes no sense because it doesn’t sort lexicographically and each component is big endian but the overall date is little endian.

Only YYYY/MM/DD HH24:MI:SS makes sense. Choose your sepators.

In everyday use, the year is the least important part. It makes perfect sense in many cases. It's in order of most relevant information to least.

YYYY/MM/DD HH:MM:SS has its place as well, but not here.

How do you write the time? Do you put seconds or minutes before hours? Why not?

How do you write the year? Do you put decade before century?

How do you write numbers? Do you put the ones place before the tens?

Toddmorey asked why units don’t go from small to large and I explained that it is inconsistent with how we write numbers.

Thus, there’s no logical reason to do anything other than large to small. Anything other than ISO 8601 is preferred only for familiarity and no such inconsistent format is inherently more correct or logical.

>How do you write the time? Do you put seconds or minutes before hours? Why not?

No, because the seconds are rarely important.

>How do you write the year? Do you put decade before century?

No, because that's not how numbers work.

>How do you write numbers? Do you put the ones place before the tens?

Same answer.

>Toddmorey asked why units don’t go from small to large and I explained that it is inconsistent with how we write numbers.

Dates aren't numbers. There is a lot more context and meaning around dates that we need to consider when we verbalise and write them. But, for the purposes of e.g. data storage then absolutely - we can consider them no different from numbers. You have to understand that isn't the case with conversational English, though.

> You have to understand that isn't the case with conversational English, though.

Yes, conversational english is arbitrary. The preference there is the familiar so the listener understands. But both commonly used date formats (MM/DD/YYYY HH:MI:SS and DD/MM/YYYY HH:MI:SS) are inconsistent and arbitrary. You can’t say one makes more sense than the other because that’s just a matter of personal familiarity.

lexicographically sorting is of lower interest to me than the other advantages. yours would also require padding numbers with leading zeroes.

If you need sorting, use a tool that understands dates, simple as that. Many tools do, just some common businesss microsoft tools don't.

Humans think day/month or month/day, they have absolutely no interest in reading the year first.

Dates should be persisted as intervals since epoch where the interval is the finest grain required. This is what enables more sophisticated tools to do sorting and change representations.

But this is a conversation about text formatting of dates. The standards for this are well established. Yes, padding is required and assumed.

> Humans think day/month or month/day, they have absolutely no interest in reading the year first.

Humans prefer what is familiar. Speaking as a human, for me that’s ISO 8601.

Oh really? I guess we’ve all been doing it wrong for centuries! Perhaps while we're at it, we should propose a new system where the months come before the days, just to keep our dates in perfect lexicographic order. Who needs tradition and worldwide acceptance, when we could have perfectly sorted dates?
Welp, that's what ISO 8601 is there for: https://en.wikipedia.org/wiki/ISO_8601
> Perhaps while we're at it, we should propose a new system where the months come before the days, just to keep our dates in perfect lexicographic order.

No need. ISO 2014 was recommended in 1971 and issued in 1973.

If you have chosen any other textual representation of date and time for data interchange you are in a very literal sense doing it wrong.

https://en.m.wikipedia.org/wiki/ISO_2014

We didn't need sorted dates before we started using unstructured media to store information.

Hand-written accounting journals, day books, have date ordering built into their physical substrate. It didn't matter how dates were given orally (some places: "today is the 23rd of June 1844"; others: "it's June 23, 1844 today"); nor did it matter that this ordering was transcribed onto the paper, using month numbers rather than the names of the months.

Now we do need to sort dates, so let's turn Japanese.

1. https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japa...

I prefer YYYY-MM-DD format because alphabetical order corresponds to chronological order.
i invented my own which i find easier or at least more useful to read, and a requirement is it does sort properly: YYYYMMmonDD

today is 202309sep21

because i use it for filenames, i don't put in extra punctuation, there are enough cues in the format as is. To really see it, imagine scanning a list of files with different dates

it will still collate properly mixed with languages other than english

Maybe I'm not understanding something, but it seems like it would not collate properly with mixed languages:

  202304abr22 - My Spanish appointment
  202304apr15 - My English appointment
  202304avr07 - My French appointment
If you placed the month at the end, it would:

  20230407avr - My French appointment
  20230415apr - My English appointment
  20230422abr - My Spanish appointment
I like that, and if day of week is relevant:

    20230915sepFRI
Or for a legibility/size tradeoff:

    2023.09.15.sep.fri
All that left is adding the Chinese zodiac year!

    2023.09.05.rab.sep.fri
Now I am just slightly bothered that the abbreviated words don’t form an isomorphic representation to the numeric. :(

    2023.09.05.3watrab.sep.3fri
There! 3rd Friday in September, 3rd Water Hare from the first in 1903! :)

(In the US we could name years in the form: 4th year of Roosevelt, etc.)

oh, you make a good point. I'm generally using it for monthly bank statements and whatnot so I'm not looking for fine grained collation, just grouping of "like with like", and i have some international accounts
It’s also consistent with ordering numbers from highest base to lowest:

    1023 (1000, 100, 10, 1)

    123.456 (100, …, 0.001)
I also like YYYY-MM-DD

To save screen space I often use decimals in file names:

    2023.05.23 Design Summary
Yeah, and that's great for storing things in databases. Not for everyday communication. We talk in terms of most relevant to least relevant - the day (or time) is typically most relevant, with the year being least.
My theory has always been that it's purely an artifact of the spoken language.

When we're saying a date out loud, we Americans tend to say, "September 21st, 2023," whereas I've noticed many of the Brits I've worked with have tended to say, "21st September, 2023," sometimes with an "of" after the day. Those spoken word orders were carried over into the written form, is my suspicion.

I guess that could be true. Certainly in the UK if someone asked you the date, you'd probably contract that to just saying "the 21st".

If the the month was unclear you might reply with "21st of what?" but you'd never expect an answer of just "September" to the question "What's the date?".

My assumption was it's due to an attempt to make the written date format closer to the HH:MM, and they just forgot about the years, with the spoken "Month, DayOfMonth" coming later.

Do people in the US generally say "the 4th of July" or "July, 4th" more? That might hint at an origin.

It depends on whether one is referring to the date (see you July 4th) or the holiday (Can't wait for the 4th of July). Though I do think the date version might be becoming more common than the holiday version.

As for why the month comes first, I get the feeling we Americans care about precision up to a month and less so about the numerical day such as "When does school start?" with an answer of "School starts in September". Obviously people need the precise date if you actually have a student going, but in a lot of conversation, people are just looking for the month. I can imagine that being even more true in earlier times.

We also peg things to months such as our elections being the second Tuesday of November or Labor Day being the first Monday of September. Note that in those phrases we are putting the day kind of first, but not in a particular numerical way. The month is what sticks out as a rough guesstimate of the time period.

I don't think that's the case; I think the spoken style is derived from the written form.
I think if you are writing for a single-language audience (as here), then the best format is to write the month in full as they advise (6 August 2018), because it will totally avoid ambiguity.
> I think if you are writing for a single-language audience (as here)

An interesting point is that the NHS has to deal with many languages and people that don't have English as a first language. That's another reason for being very explicit.

Cue: a comprehensive map of all the countries that use the MM/DD/YYYY format

https://twitter.com/TerribleMaps/status/1620111664078290945

I usually know what month it is. I often have no idea what day it is. Anchoring date format in month first gives me a warm-fuzzy that allays anxiety when I’m punched in the gut by the mysterious “day of month” detail. I usually need to know today’s date more often than I need historical ones.

None of this helps with organizing photo libraries, legal documents and video archives.

/s but maybe not…

Dates like 2023-09-21 looks like a pretty good approach, except, apparently, when communicating with Kazakhstan-related peers.
What's up with Kazakhstan-related peers?
Per Wikipedia, one of the formats used there is yyyy.dd.mm

https://en.wikipedia.org/wiki/Date_format_by_country