News for hackers. Stuff that matters.
Re:Does Your Code Pass the Turkey Test? by SideburnsOfDoom on Friday December 06, 2024 @04:04PM (#42344414)
As for dates and times interchange, use ISO 8601 (largest to smallest order).

The EU and many other countries ordering of day, month, year (smallest to largest order) also makes sense, but is sadly ambiguous due to

The US format of month, day, year (middle-endian order) https://9gag.com/gag/a2KEqOe

US not TUrkey is the outlier

Re:Does Your Code Pass the Turkey Test? by nayuki on Friday December 06, 2024 @04:52PM (#42344910)
DMY dates don't make sense. The units are from smallest to largest, but the string within each unit is still written from biggest to largest.

Furthermore, if DMY makes sense, then you could argue that SS:MM:HH or MM:HH has a valid use case. (It does not.)

Hence, ISO 8601 is the one true date format, assuming you still believe in writing numbers in big endian.

If you want, you can argue for numbers being written in little endian. For example, the year "two thousand twenty-four" could be written as 4202, and maybe pronounced as four twenty thousand-two. In that case, go ahead and write dates as SS:MM:HH DD/MM/YYYY; it is UTC 61:45:12 60/21/4202.

Re:Does Your Code Pass the Turkey Test? by mrweasel on Friday December 06, 2024 @05:17PM (#42345167)
> DMY dates don't make sense.

This is a language issue. DMY makes perfect sense in languages where you'd normally say the date in that sequence. The "problem" is that English doesn't do that. The natural flow in English is MDY, e.g. July 4th, 2024. That not how Germanic language (at least those I know) works. In Danish or German you'd say "4th July, 2024", that's just how those languages work.

I do agree that for computing ISO 8601 is the way to go as it sorts correctly.

Re:Does Your Code Pass the Turkey Test? by mphalan on Friday December 06, 2024 @05:24PM (#42345214)
In England (and Ireland). One tends to say “The 4th of July”. “July 4th” is an Americanism.
Re:Does Your Code Pass the Turkey Test? by HideousKojima on Friday December 06, 2024 @05:31PM (#42345278)
Both "the 4th of July" and "July 4th" are common in American English
Re:Does Your Code Pass the Turkey Test? by SideburnsOfDoom on Friday December 06, 2024 @05:32PM (#42345290)
Yes, and only "the 4th of July" is common in UK English.
Re:Does Your Code Pass the Turkey Test? by Izkata on Friday December 06, 2024 @08:49PM (#42346560)
Only because that's a holiday. The 23rd of March sounds a bit formal here compared to March 23rd, and sounds like it refers to an event or holiday. Wedding invitations might sometimes use that style, for example.
Re:Does Your Code Pass the Turkey Test? by brudgers on Friday December 06, 2024 @11:23PM (#42347257)
“Independence Day” is the relevant Americanism.
Re:Does Your Code Pass the Turkey Test? by lostlogin on Friday December 06, 2024 @07:14PM (#42346024)
> The natural flow in English is MDY

In your English maybe. That’s just not a good argument.

Re:Does Your Code Pass the Turkey Test? by Daneel_ on Friday December 06, 2024 @07:26PM (#42346092)
That’s highly specific to the US. Most other English-speaking countries say “the Fourth of July”. To me it feels weird to say July fourth.
Re:Does Your Code Pass the Turkey Test? by LimeLimestone on Friday December 06, 2024 @07:45PM (#42346208)
"July fourth" kinda sounds like there are multiple Julies this year and this is the fourth one :D
Re:Does Your Code Pass the Turkey Test? by SideburnsOfDoom on Friday December 06, 2024 @05:23PM (#42345213)
> The natural flow in English is MDY, e.g. July 4th, 2024.

I'm sure that's true. This seems more like US custom than the whole English language. "July 4th" sound a bit forced and not natural to me, and I am a native English speaker. Not US English though.

Re:Does Your Code Pass the Turkey Test? by SideburnsOfDoom on Saturday December 07, 2024 @04:40AM (#42348501)
> I'm sure that's true.

I accidentally an important word there. It should be "I'm not sure that's true." It's an English expression that's a bit understated: it means "I'm confident that this is wrong".

You can't always argue from "what feels natural" - that's prone to mere familiarity (1), and someone else who is more used to the other way will have the opposite "feel". It's subjective, and not universal.

1) https://en.wikipedia.org/wiki/Mere-exposure_effect

Re:Does Your Code Pass the Turkey Test? by okanat on Friday December 06, 2024 @07:02PM (#42345958)
Both DMY and HMS are sensical notations of time. For most people the day is the most important part of the cycle in a year. We measure most of our actions and chores in days then months then years. In a meeting, in official letters, taxes etc. everything is specified in days.

Similarly hour is the most common division of a day. Generally humans have an internal tendency to measure things in half of an hour interval and hour is the closest one. One usually rents a parking slot for integer multiples of an hour. The travel distances are specified in hours or fractions of it

Putting the most important measure at first just makes sense.

Re:Does Your Code Pass the Turkey Test? by elpocko on Friday December 06, 2024 @05:08PM (#42345072)
That's crazy. What's next, abbreviating "Coordinated Universal Time" as UTC instead of CUT?
Re:Does Your Code Pass the Turkey Test? by SideburnsOfDoom on Friday December 06, 2024 @05:10PM (#42345085)
> then you could argue that MM:HH has a valid use case. (It does not.)

"twenty past ten"

(It does.)

Re:Does Your Code Pass the Turkey Test? by Dylan16807 on Friday December 06, 2024 @07:22PM (#42346070)
"twenty till ten" is just as valid, so I don't see either of those as a true example of MM:HH.