Hacker News new | ask | show | jobs
by purple-leafy 744 days ago
> Driving on the right

No thanks

> 2024-06-09 date format

That doesnt infer what you want. Are you saying you want YYYY-MM-DD or YYYY-DD-MM

6 comments

Look at what date it is today, and then try to guess which one of these format is the one they are referring to.

Also: one of these is an ISO standard format. The other one is a format that no one would use. (DD/MM YYYY is in use, but no one would write YYYY-DD-MM.)

Don’t Americans do:

MM-DD-YYYY?

So it would stand to reason that an American commenter may be meaning

YYYY-DD-MM

And guessing based on todays date, tell that to commenters who check this post in 6 months

Americans do mm/dd/yyyy, but never mm-dd-yyyy
Nobody ever should write YYYY-DD-MM, its the worst of both worlds with the structure being both in a non-logical order AND not conforming to how dates are pronounced.
Just in case it isn't clear, the usual European date format (DD-MM-YYYY though the separators vary) reflects the usual pronunciation ­— even in Britain and Ireland, where today is the ninth of June.
They want YYYY-MM-DD
Underscore as a separator, YYYY_MM_DD:

  1970_01_01
  2024_06_09
  2024_12_31
  16383_12_31
Treated as base-10 number literal in some programming languages.

5 bits for DD [0, 31] + 4 bits for MM [0, 15] + 14 or more bits for year [0, 16_383] = 23 bits.

Just use uppercase numbers for the month and lowercase for the day. That way you will always know which is more significant without any prior knowledge of how the order of the digits in decimal numbers work.
> YYYY-DD-MM

Some people just want to watch the world burn