Live data from Hacker News

ISO 8601: a better date format

kirby.kevinson.org

1–10 of 437 posts

Re: ISO 8601: a better date format

#5
post #2

The real purpose of endianness which is missed here is the ability to sort. Sorting a list of iso8601 dates alphabetically means sorting them chronologically too.

Until we hit year 10000, but yeah, that's still a looong time to go.

Re: ISO 8601: a better date format

#6
The real advantage is that Azure and AWS and every other US-centric cloud service insists on showing me that something happened on the 3/11/2021.

It's a wild guess to figure out if that is the 11th of March or the 3rd of November.

Unless there's also another date with a number higher than 12 in it, there is no way to tell. None. None whatsoever.

For US staff with US regional settings, it's always obvious which date is correct. That is the one single case where there is no confusion. This works as expected for just 4% of the world population, but it is those 4% of the world that get to decide the date format.

It's the most obnoxiously American attitude imaginable to ignore this issue because it doesn't affect them... only the other 96% of the planet.

/rant over

Re: ISO 8601: a better date format

#8
post #2

The real purpose of endianness which is missed here is the ability to sort. Sorting a list of iso8601 dates alphabetically means sorting them chronologically too.

It's there:

> This not only makes all of the dates look equally nice, but also, coupled with other quirks of this format, allows the files with the date in the name to be sorted just by the filename.

My issue is with:

> Simplified, the core date format looks like this: yyyy-mm-dd hh:mm:ss

Here are the examples at https://en.wikipedia.org/wiki/ISO_8601

  2021-02-26T06:22:59+00:00
  2021-02-26T06:22:59Z
  20210226T062259Z
Note the "T" instead of a space between the date and time? That's what the spec says: https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_tim... . "Separating date and time parts with other characters such as space is not allowed in ISO 8601, but allowed in its profile RFC 3339."

Note the optional use of "-" and ":"? That's "basic" vs. "extended" formats.

Plus the optional timezone specifier (if not present, assume it's the same timezone).

There's also optional support for microseconds.

Re: ISO 8601: a better date format

#9
There's another aspect you may not know about: It's close to how it's done in chinese, which is 2021年3月17日. They use different separators (the chinese words for year, month and day), but it's close enough.

Given that china is the country with the largest population it may not be a bad idea to use something a large number of people will easily understand.

Re: ISO 8601: a better date format

#10
post #8
post #2

The real purpose of endianness which is missed here is the ability to sort. Sorting a list of iso8601 dates alphabetically means sorting them chronologically too.

It's there: > This not only makes all of the dates look equally nice, but also, coupled with other quirks of this format, allows the files with the date in the name to be sorted just by the filename. My issue is with: > Simplified, the core date format looks like this: yyyy-mm-dd hh:mm:ss Here are the examples at https://en.wikipedia.org/wiki/ISO_8601 2021-02-26T06:22:59+00:00 2021-02-26T06:22:59Z 20210226T062259Z No…

I omitted this detail on purpose to not distract the reader who doesn't know much about date formats.
Post reply on HN