this post was submitted on 01 Dec 2023
147 points (98.0% liked)

Programmer Humor

32000 readers
1744 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

I know this isn't any kind of surprise, and yet, well...

top 30 comments
sorted by: hot top controversial new old
[–] [email protected] 21 points 9 months ago (6 children)

2100 and 2400 will be a shitshow

[–] [email protected] 11 points 9 months ago (1 children)
[–] [email protected] 2 points 9 months ago

Yeah that's a different shitshow but agreed it is likely to be worse - like y2k the effects are smeared out before and after the date.

[–] [email protected] 2 points 9 months ago (1 children)

Nah.

Same thing happened in 2000 and it was a mouse’s fart.

[–] [email protected] 2 points 9 months ago (1 children)

Because of months of preparation. I know, I was doing it.

[–] [email protected] 1 points 9 months ago (1 children)

And now that every time library has been updated, we're safe until our grandchildren reimplement those bugs in a language that has not yet been invented.

[–] [email protected] 2 points 9 months ago (1 children)

I've already seen reimplementation of 2 digit dates here and there.

[–] [email protected] 1 points 9 months ago (1 children)
[–] [email protected] 1 points 9 months ago (1 children)

Fortunately I will not be involved. Hopefully I can make something from 2038 though.

[–] [email protected] 1 points 9 months ago

You’re not the only one forseeing a nice consultant payday there.

[–] [email protected] 2 points 9 months ago (2 children)
[–] [email protected] 6 points 9 months ago

2100 not a leap year (divisible by 100). 2400 is a leap year (divisible by 400). Developing for dates is a minefield.

[–] [email protected] 4 points 9 months ago

Because they're not leap years but are 0 === year % 4

[–] [email protected] 2 points 9 months ago

Luckily, none of us will be there.

[–] [email protected] 1 points 9 months ago

Yeah but I'll be dead so not my problem lmao

[–] [email protected] 1 points 9 months ago (1 children)

Won’t the computer’s clock reset every time you go to sleep and stop cranking the power generator?

[–] [email protected] 3 points 9 months ago

Yeah who knows if our computers are sticks by either date

[–] [email protected] 20 points 9 months ago (2 children)

Then there's my code, which didn't even survive the time change.

[–] [email protected] 4 points 9 months ago (2 children)

In every project I've ever worked on, there's been somebody who must have been like, "HurDur Storing timestamps in UTC is for losers. Nyeaahh!"

And if I ever find that person, I'm going to get one of those foam pool noodles, and whack him/her over the head with it until I've successfully vented all my frustrations.

[–] [email protected] 3 points 9 months ago

I just use a float between 0 and 1 with 0 being 1970 and 1 being the predicted heat death of the universe.

[–] [email protected] 1 points 9 months ago (1 children)

The only time using UTC breaks down is when any sort of time change gets involved.

If I say I want a reminder at 9am six months from now and you store that as UTC, a day light savings change will mean I get my reminder an hour early or late depending on where in the world I am

[–] [email protected] 1 points 9 months ago

But wouldn't you calculate the time in the future in the right time zone and then store it back as UTC?

[–] [email protected] 2 points 9 months ago (1 children)

Your code made it to the time change!!?

[–] [email protected] 2 points 9 months ago

Same... The change from 12 to 1

[–] [email protected] 7 points 9 months ago* (last edited 9 months ago)

People who haven't had a birthday in almost four years are like

reaction gif of a little boy busting out a funny celebratory dance in the stands of (probably) an unknown sports event.

[–] [email protected] 1 points 9 months ago

I hope the homeassistant guys already have this covered, because I didn't use it 4 years ago to know

[–] [email protected] 1 points 9 months ago (1 children)

I'm not worried about my code, I'm (very slightly) worried about all the date libraries I used because I didn't want code that shit again for the billionth time.

[–] [email protected] 2 points 9 months ago (1 children)

Your comment made me go look at the source for moment.js. It has "leap" 13 times and the code looks correct. I assume they test stuff like this.

[–] [email protected] 1 points 9 months ago

Yeah, I'm generally using the common data/time libraries in most (if not all) languages and I'm pretty sure they've all been through more than 1 leap year at this point. I just never 100% trust the code I don't control - 99.9% maybe, but never 100.

[–] [email protected] 1 points 9 months ago

I'm not worried at all - I love me some tz database.