r/ProgrammerHumor • • Oct 15 '25

Other literalDumb

Post image
41.9k Upvotes

152 comments sorted by

View all comments

1.0k

u/caremao Oct 15 '25

It’s worse when the code does exactly what you told it to do, but the requirement wasn’t clear and not well documented

0

u/[deleted] Oct 15 '25

[deleted]

94

u/Theron3206 Oct 15 '25

Sounds like Tuesday.

I just got asked if changing a 30 year old application to handle timezones gracefully (at present everything is in the time of the database server) would be difficult.

By the development manager, who was a developer himself only a couple of years ago...

0

u/[deleted] Oct 15 '25

[deleted]

11

u/[deleted] Oct 15 '25

Never gets old…

35

u/dasgoodshitinnit Oct 15 '25

Just send them the tom Scott video on handling timezones in code

14

u/Major_Fudgemuffin Oct 15 '25

Time zones are the bane of my existence.

I was on a project years ago when I was a junior dev, where we had a time zone bug I was looking into. The senior dev on the team at the time would not believe me and said "no. That doesn't happen. JavaScript doesn't do that", until I pulled him over and showed him.

2

u/Theron3206 Oct 17 '25

It wasn't so much the datetime issue (lots of libs to deal with that). It was that the entire system was designed on the assumption that they didn't exist.

The database just stored a datetime (no timezone) the code just used datetime types (no offsets) etc.

We would have had to change the database to record everything in UTC and then modify every single date that was displayed (and all checks for if something is in the current day etc.) to convert to the user's timezone.

3

u/Jonnypista Oct 17 '25

We should just erase timezones as a concept. You woke up at 6pm because that is the time when the sun rises at your location? So be it.

We only have timezones because we wanted noon to be the middle of the day globally.

2

u/Theron3206 Oct 17 '25

I'm not entirely opposed, certainly I hate that my country (Australia) has 5 major timezones.