this post was submitted on 03 Apr 2024
384 points (95.5% liked)

Programmer Humor

32568 readers
748 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
all 41 comments
sorted by: hot top controversial new old
[–] Ghostalmedia@lemmy.world 51 points 7 months ago (2 children)

My take:

Daylight savings = bad

Time zones = good

If everyone had the same clock time, we would need to know when it was morning, midday and evening for people in other locations. Scheduling stuff between locations would still suck, but it would suck differently.

[–] Carighan@lemmy.world -1 points 7 months ago (2 children)

Yeah but it could be improved by not using arbitrary country-decided timezones and instead simply listing "diurnal time", basically. And then clocks could get normalized as always showing UTC nearby, too. For communication.

[–] PowerCrazy@lemmy.ml 22 points 7 months ago

That's not reasonable at all. The purpose of time is to help organize society across distance. The purpose of states/countries/administrative districts is to help organize society within a similar geographical region. It is entirely reasonable for timezones to conform to political boundaries.

[–] pingveno@lemmy.ml 14 points 7 months ago

I don't know about that, it seems like one of the things that makes the world simple for programmers and complex for everyone else. It doesn't allow for large countries to split along sensible political boundaries. So if one boundary slices through the middle of New York City, too bad. Moving boundaries to instead be at state/province/etc boundaries or in the middle of nowhere like we usually see now seems more sensible.

[–] AdamEatsAss@lemmy.world 30 points 7 months ago (4 children)

Even worse. Daylight savings creators. I work in manufacturing and we literally stut down the production line for an hour during the "fall back" and "spring ahead" so we can manually change the time on every computer.

[–] lowleveldata@programming.dev 9 points 7 months ago

Sounds like fun time

[–] ADTJ 6 points 7 months ago (1 children)

Does it matter if those machines are an hour out for 6 months? Why not just keep them on UTC as a rule?

[–] AdamEatsAss@lemmy.world 4 points 7 months ago (1 children)

For quality control it did. The real concern is people messing up time. If there was a quality complaint we wanted it to be easy for people to go back thru production data. A lot of the people operating the machinery and performing quality checks at our facility are not well educated, and the need is there to make investigating quality tasks/entering quality data very easy.

[–] corsicanguppy@lemmy.ca 3 points 7 months ago (1 children)

thru

I'd hate to see people cutting corners.

[–] AdamEatsAss@lemmy.world 1 points 7 months ago

Thru is the USA spelling. There's nothing wrong with using it.

[–] master5o1@lemmy.nz 5 points 7 months ago

At least we don't use the Roman method of varied hour lengths depending in the time of day and times of year.

[–] turbowafflz@lemmy.world 5 points 7 months ago

I interpreted the typo as strut instead of shut at first and it was way funnier that way

[–] azimir@lemmy.ml 18 points 7 months ago (1 children)

Time is possibly one of the hardest things to handle properly for a coder. There's plenty of hard problems (network loss, 3 phase commits, etc), but time stand out as really annoying.

Another one is colors. All it takes is one library to encode colors in a weird way and then mapping them between libraries is a mess.

[–] ryathal@sh.itjust.works 4 points 7 months ago

Time is annoying, but it's mostly solved. The problem is people don't use the solutions and make their own things that don't actually work.

[–] intensely_human@lemm.ee 14 points 7 months ago

Yeah but good luck time traveling to the right moment to catch that guy.

“Oh him? He was here three hours ago”

[–] Kidplayer_666@lemm.ee 7 points 7 months ago (1 children)

Without time zones it would be worse. Every little town would have their own time, calculated from their position

[–] flashgnash@lemm.ee 5 points 7 months ago (1 children)

At least then everyone would be thinking about it and using UTC, not writing their programs to rely on the timezone always being the same

It's too easy a problem to ignore/overlook right now

[–] electricprism@lemmy.ml 3 points 7 months ago* (last edited 7 months ago) (1 children)

I agree, UTC for global is fine, might as well just do localized time as

Sun-up, 1st hour of the day, ,2nd, 3rd... Sunset for locale

[–] Bene7rddso@feddit.de 3 points 7 months ago

For the afternoon We could count the hours until sunset

[–] MoonMelon@lemmy.ml 7 points 7 months ago

Wasn't it the railroads at the end of the 19th century? Yeah... they would kick our asses.

[–] deathmetal27@lemmy.world 6 points 7 months ago

I'd do this to all the guys who introduced different charsets.

[–] tobogganablaze@lemmus.org 5 points 7 months ago

Yeah, screw Kaiser William.

[–] poinck@lemm.ee 5 points 7 months ago (1 children)

What about time on a different planet? What would be a common time"zone" for Mars and Earth?

[–] Cysioland@lemmygrad.ml 3 points 7 months ago

I need to save up enough dough to be able to early retire the moment I hear that we need to adapt our software to Martian Time

[–] Daxtron2@startrek.website 5 points 7 months ago (2 children)

Store times in UTC, convert in UI to locale's timezone with one of any of the millions of timezone libraries. If you're storing in local time, you're gonna have a bad time.

[–] ShortFuse@lemmy.world 2 points 7 months ago* (last edited 7 months ago)

Timestamp in UTC

But for time of day, use local time and store separate column with the timezone name. Don't use timezone offsets since that doesn't work with DST. You're better off with something like America/New_York because God knows what 2030 will look like.

And if timezone are abolished, or DST, that's even more reason to store the timezone name.

[–] Phrodo_00@lemmy.world 1 points 7 months ago (1 children)

It depends. If something needs to happen in local time (like, always at the same time regardless of daylights savings for example) you should be storing times in local timezone

[–] Daxtron2@startrek.website 2 points 7 months ago (1 children)

Store in UTC with the tz offset and if you're using a modern tz library, that should handle it for you.

[–] Phrodo_00@lemmy.world 2 points 7 months ago

tz offset is really not enough. You'd need to save the time zone id and/or offset, to have you library calculate deviations such as daylight savings.

Even that, that would break if the user moves and now what they setup is using their previous timezone.

Basically, I'm saying that storing the offset works most of the time, but not all of the time.

[–] devilish666@lemmy.world 4 points 7 months ago (2 children)

Leap year creator has left the chat & blocked.......

[–] diverging@lemmy.ml 7 points 7 months ago

Leap year creator

That's Julius Caesar. Sort of...

[–] deathmetal27@lemmy.world 5 points 7 months ago

TBH leap year is needed because of the ~0.25 day error in the Earth's revolution around the sun.

[–] FriendBesto@lemmy.ml 3 points 7 months ago* (last edited 7 months ago)

Nice. LOL

Quality joke, right here.

[–] corsicanguppy@lemmy.ca 2 points 7 months ago* (last edited 7 months ago)

We'll round up the DST people right after we eradicate this kid-pidgin, rounding up the 'u' and the 'r' indolents.

Let's grab the people who don't know 'will' from 'would', as well. No child left behind.

Average IQ in America will skyrocket.

[–] aaa@mujico.org 1 points 7 months ago

I recall having this conversation about a world with same TZ in the world with my teameates, one of them responded with "wait.... we will be still sleeping in the night ¿right?"