Remix.run Logo
nkrisc 7 hours ago

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.

RobotToaster 6 hours ago | parent | next [-]

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

suzzer99 19 minutes ago | parent | next [-]

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.

8organicbits 5 hours ago | parent | prev [-]

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.

stephbook 5 hours ago | parent | next [-]

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?

embedding-shape 4 hours ago | parent | prev [-]

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.

hn_throwaway_99 3 hours ago | parent | prev | next [-]

> 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.

microsoftedging 5 hours ago | parent | prev | next [-]

Iso 8601![0]

[0] https://en.wikipedia.org/wiki/ISO_8601

anamexis 7 hours ago | parent | prev | next [-]

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

andai 7 hours ago | parent | prev | next [-]

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.

JoshTriplett 2 hours ago | parent | prev | next [-]

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.)

cush 6 hours ago | parent | prev [-]

This has a solved problem for a long time