Is 03/04/2026 March 4th or the 3rd of April?

If you have an international audience that’s going to mess someone up.

Better yet require YYYY-MM-DD.

<input type="date"> is automatically formatted based on the user's locale.

Input type=date also just saves the day, month and year with no timezone information, which makes sense since the widget doesn't show any and context determines if the date should be in the user's timezone or a fixed timezone (like an event start date or a flight departure). But if you don't immediately convert that date to an ISO date and instead save it to the DB as yyyymmdd, you're in for a world of hurt trying to display date/times throughout the site. I inherited a project like this and have spent countless hours wrestling with nightmare timezone issues.

This is still a partial solution as the user needs to know that their locale is being used and know how their locale is configured to understand the format. This is most problematic on shared computers or kiosks, especially when traveling.

I don't even know my locale.

Is is the device display language, the keyboard input language, my geo location, my browser language, my legal location, my browser-preferred website language, the language I set last time, the language of the domain (looking at amazon.co.uk), the language that was auto-selected last time for me on mobile or... something else entirely?

Exactly. Under Windows, this isn't even consistent across applications. I'm in France, with the location set to France, using English display language and "English (Europe)" formatting. This means that the expected date is DD/MM/YYYY. It's what shows up in the taskbar, for example. But many applications seem to do this based on language, so I sometimes get MM/DD/YYYY.

I don't normally run Windows, so I can't check right now, but I think it's mostly "modern" applications that mess this up. Like the MS Store, Teams (obviously).

the only locale i know about is the windows one that's hidden in some menu that i had to set to japan to get some random application to run, and now all of my backslashes look like yen symbols :P ... maybe i won't get mm/dd/yyyy now!

I think modern browsers are actually quite good here. They show a template in the form TT.MM.JJJJ for me (so the German equivalent of MM/DD/YYYY, with the usual order and separator in German). I can just type the date, including the dots if I want (they're just ignored; there would be extra points for moving me to the next component when typing "2.", but the world's not perfect). If I'm confused about the format, or want to see a calendar view, I can click on the calendar icon (also accessible via tab) and select a date there.

For normal date inputs, I really don't think there is a good reason to use anything else. (Possible exceptions I can think of: Selecting date ranges and/or showing extra data about the dates (like daily prices).)

No, modern browsers are horrible at this as they are often ignoring your settings (at least Chrome and Edge on Windows do). They are basing the format entirely on the language instead of the date format configured in your Windows settings. Safari on iOS seems to not have this issue though as far as I can tell.

https://stackoverflow.com/questions/7372038/is-there-any-way...

I mean, once in a different country, you either experience the locale shock once then adapt, or you've seen it before and kind of know what to expect.

And for the rest of the users who have no idea about locales, using whatever locale they have on their computer might be technically incorrect for some of them, but at least they're somewhat used to that incorrectness already, as it's likely been their locale for a while and will remain so.

Well, the issue is when the applications look at the wrong configuration to set this up.

Think about traveling to a different country for a limited time. I want my location, time zone, etc to be set to where I am. I traveled across the US a few years ago, and I would rather not have to mentally follow in which time zone I was. Heck, I don't even know where the limits are. Bonus points for DST happening on a different date than in Europe, and extra bonus for there being no DST in Arizona, except for Navajo Nation? I remember signs saying it was illegal to carry alcohol, but I don't recall anything about time zones.

But as a European, I don't want my date to suddenly appear in US format; I'm only there for a few weeks.

> And for the rest of the users who have no idea about locales, using whatever locale they have on their computer might be technically incorrect for some of them, but at least they're somewhat used to that incorrectness already, as it's likely been their locale for a while and will remain so.

Not really. A lot of computers are set to US locale (probably because it's the default) and the user just has no idea why some programs have dates in some crazy middle-out format and avoids those programs.

That can get messy and confusing if the user's locale is different from the language of the web page.

When I write in English, I of course also want to edit dates and numbers using English conventions. But instead, I am forced to use decimal comma and day/month order because those are the default locale for Swedish, which is my default locale. I have never encountered an OS that doesn't work that way. On the web you'll often don't know: it could be anything.

> Better yet require YYYY-MM-DD

This is the equivalent of requiring all your text to be in Esperanto because dealing with separate languages is a pain.

"Normal" people never use YYYY-MM-DD format. The real world has actual complexity, tough, and the reason you see so many bugs and problems around localization is not that there aren't good APIs to deal with it, it's that it's often an after thought, doesn't always provide economic payoff, and any individual developer is usually focused on making sure it "looks good" I'm whatever locale they're familiar with.

It's normal in Asia.

I'm not in Asia though.

It's also normal to speak Chinese in China. That doesn't mean that I should be speaking Chinese as well.

> "Normal" people never use YYYY-MM-DD format.

My point was that this isn't true.

And Sweden. And probably lots of other countries too. It's a world standard, and there are very few places that use hyphens in dates that are not ISO dates.

Or:

- Use localization context to show the right order for the user

- Display context to the user that makes obvious what the order is

- Show the month name during/immediately after input so the user can verify

A partial solution is to put DD/MM/YYYY (or the appropriate format) as the input placeholder. You could also display the format as a tooltip when the input field is focused. IMO this is better than dealing with date pickers.

I've seen some that had a drop-down for the month name. But since it was native, I could type the month name and my browser selected the right one.

As they type it, start displaying what it is. If, as you type "03/", it says "March", and that's not what you want, you now know what format it wants.

(And yes, always accept YYYY-MM-DD format, please.)

Ah, the MS Word experience:

User enters German date "1. April"

MS Word: new ordered list with item "April"

User furiously hits delete key.

This has a solved problem for a long time