r/ProgrammerHumor • • Oct 13 '26

Meme chaoticEvil

Post image
3.4k Upvotes

262 comments sorted by

View all comments

Show parent comment

115

u/ThatGuyYouMightNo Oct 13 '26

Two users want to enter October 12th. One enters 12/10/2026, the other enters 10/12/2026. One of them gets pissy when it comes up as December 10th.

25

u/coderman64 Oct 13 '26

Solution: use ISO 8601 and piss off everyone equally.

4

u/Usefullles Oct 14 '26

Won’t this just be an inverted DDMMYYYY format in most cases? Like, what’s so different between the DDMMYYYY and YYYYMMDD formats? In cases where you don’t need to take hours and minutes into account, of course.

8

u/coderman64 Oct 14 '26

One of the major advantages is that if you sort YYYYMMDD in order by numerical value, it also sorts by date.

3

u/Blecki Oct 14 '26

Use 8601 for everything whenever possible

45

u/RKGamesReddit Oct 13 '26

I see sites use three different fields just to eliminate the problem

14

u/IndependenceSudden63 Oct 13 '26

This is the way.

29

u/NiIly00 Oct 13 '26

Solution: Ignore everyone that uses the moronic format mm/dd/yyyy.

They deserve it.

7

u/Triffinator Oct 13 '26

Very true. It's programmatically (and human) parseable if the middle column exceeds 12, but fails the second you are lower than 13. It also happens to work out on any dates with matching day and month.

Like, is 10/12 December 10th or October 12th?

1

u/Crash_Logger Oct 15 '26

And then I try to input 2026-10-12 and get pissy when the UI re-writes it as 20/2/6

0

u/pjkm123987 Oct 13 '26

easy just have dd/mm/yyyy placeholders

13

u/Dudeonyx Oct 13 '26

It's cool that you think that would help much

12

u/Gunmetalstorm Oct 13 '26

You're assuming users will read.

8

u/Triffinator Oct 13 '26

Can confirm. A website we host at work is used by about 100k people a year. It used to require a date to be entered in a text box. The text box had placeholder text and was validated to support DD/MM/YYYY format. An error message would spell this out to you.

We got many support calls because people couldn't use it and when we find out why, they had decided to enter the date in another format and wouldn't read the error or placeholder text. We changed to a date picker and the complaints went away.

-6

u/Nick0Taylor0 Oct 13 '26 edited Oct 13 '26

Which is super easy to fix by using the browsers selected date formatting

3

u/Triffinator Oct 13 '26

Depending on use case, a standard formatting makes sense. If you're delivering a service or website for a local community or even as large as a country, a reasonable expectation is that they use the standard formatting for the region. It's less work for you to support and implement.

The best thing to do internationally is to capture dates in YYYYMMDD and its variants for the same reason. You can more easily support the application/webpage and the input format is more globally intuitive than other formats.

You should use dedicated date input UI elements and not just a single text box.

-1

u/Nick0Taylor0 Oct 13 '26

How does where the site is used come into it? What frontend framework these days doesn't support "hey what date format does the current user use on this machine? Convert it to UTC timestamp". I never said you should use a single text box, just that you should offer an input field and not just the date picker, plenty of pre-made UI elements come with both and you can enable/disable them.

2

u/Triffinator Oct 13 '26

How does it not matter?

You're working on the assumption that every device is a personal device. Our website fits a certain demographic where users are more likely to be using a communal PC either at home or in a library. The date setting on the PC will not always align with the date format the user prefers in our case.

Other than that, a business, school or government office may have set GPOs to have the business's preferred date format. Again, the user doesn't control these and their preference for dates does not match the user's.

By enforcing our own preference for dates format, we prevent issues where the user's preferences don't align with the person who set up their PC.

-1

u/Nick0Taylor0 Oct 13 '26

So instead of maybe sometimes being wrong because it's not a personal computer AND we happen to get a user who is working on a machine that doesnt use his/her preferred formatting, which is gonna be a fairly rare occurrence we're just gonna be wrong anywhere that uses a different format from our own and fully prevent any user choice?
How many times have you gotten a call "hey the website/app is using the computers settings, we don't want that"? Thats literally what those settings are for. I've definitely seen "hey the website/app doesn't respect my system settings" plenty of times.

2

u/Triffinator Oct 13 '26

In our clientele, it is more likely they don't have a personal computer.

Without giving much away about my work (work has policies regarding open discussion of ourselves on social media, what I have said is not a problem, but revealing too much more could be), it is more likely that our users are using the websites on a shared family PC, community library PC, government organisation PC or care facility PC than their own personal computer.

I agree that if a personal PC was the most likely choice, then it would make sense to use the preference set in the system settings. I think that you are missing key information on why certain decisions have been made and experiences we've had that have informed our decisions. The best general solution for a problem is not always the best specific solution for a problem.

0

u/Nick0Taylor0 Oct 13 '26

And those shared family, library, government or care facility PC's don't generally use a date format your users will understand?

1

u/Triffinator Oct 13 '26

Again, it's based around our clientele and circumstances, but yes, it is likely.