246 points

I’m ok with timezones, but the guy who invented daylight savings time I’d slap to all the way to the sun

permalink
report
reply
18 points

From a development perspective it certainly sounds easier to have one global timezone with DST than a bunch of smaller ones without it. Would that make sense in reality? Probably not but I definitely think timezones take more work to compensate for properly.

permalink
report
parent
reply
49 points

What matters is consistency and our time system has tons of crazy inconsistent shit in our. Everyone knows about leap years, but do you know about leap seconds? Imagine trying to write a function to convert unix time to a current date and suddenly all your times are a second off.

Just look at this insane bullshit nonsense. The added complexity of time zones and daylight saving time is nothing compared to simply supporting our time system.

permalink
report
parent
reply
6 points

We need to synchronize all computer times with that one clock that can stay accurate to within 1 second every 40 billion years.

permalink
report
parent
reply
2 points

Incredible list, the scale.

The software will never run on a space ship that is orbiting a black hole.

hmm
A little aspirational?

permalink
report
parent
reply
4 points
*

Not really. Timezones, at their core (so without DST or any other special rules), are just a constant offset that you can very easily translate back and forth between, that’s trivial as long as you remember to do it. Having lots of them doesn’t really make anything harder, as long as you can look them up somewhere. DST, leap seconds, etc., make shit complicated, because they bend, break, or overlap a single timeline to the point where suddenly you have points in time that happen twice, or that never happen, or where time runs faster or slower for a bit. That is incredibly hard to deal with consistently, much more so that just switching a simple offset you’re operating within.

permalink
report
parent
reply
1 point
*

Lets just have 2 timezones, Chinese time and EST w/ permanent DST. The most populated timezones for Eurasia and the americas, and they’re both 12 hours apart, so nobody has to do timezone math, just swich AM and PM.

permalink
report
parent
reply
6 points

There was actually a really interesting idea I heard to have no time zones. And I actually think it could be a good idea. It’ll never happen because people would need to re-learn time but if it was always the same time everywhere it would make scheduling and business so much easier. No one would need to convert between different zones or be late because of an incorrect conversion. The downside is that times which are conventionally morning or evening etc, would no longer would be so people would have to get used to time just being a construct for scheduling and not a representation of the natural day/night cycle…but it actually doesn’t sound like a half bad idea.

permalink
report
parent
reply
8 points

Switching sucks but DST is better than Standard Time.

permalink
report
parent
reply
13 points
*

Which part of the year is DST and which part is Standard Time?

I know, but it seems like half the people that say they prefer DST have it backwards.

permalink
report
parent
reply
13 points

It’s easy, the good part is DST (which is what we’re currently in - Spring through Fall in the northern hemisphere).

permalink
report
parent
reply
-1 points

i still dont even understand what DST even is, as far as i care because i don’t is that DST just means we change the time, because god forbid the time be a little funky.

permalink
report
parent
reply
4 points

DST vsm Standard time literally doesn’t matter. It’s the switching between the two that kills people.

permalink
report
parent
reply
2 points

The real problem is that across the globe there is like 50 different implementations of it. Some places have a fucking half hour, or some goofy shit. Really fun handling time zones with that sprinkled on top.

permalink
report
parent
reply
5 points

Love me some early evening daylight though. Nice warm but not hot cruise/drive with the windows and the top down on the car.

permalink
report
parent
reply
5 points

I love DST! I just think ever switching out of it is where the mistake lies

permalink
report
parent
reply
-1 points

DST during winter = permanent depression.

permalink
report
parent
reply
10 points
*

You are aware that the actual amount of daylight doesn’t change when we move the clocks right?

It really comes down to when you’d rather have more daylight, morning or evening.

permalink
report
parent
reply
3 points

Isn’t that Benjamin Franklin or did West Wing lie to me?

permalink
report
parent
reply
-1 points

and id put him back and lovingly nurse him back to health. big hero.

permalink
report
parent
reply
-18 points

IIRC daylight savings was created way back when electricity really didn’t exist so it allowed the farmers more daylight to harvest their crops.

Now with that said there is more technology in today’s farming equipment so DST shouldn’t really exist anymore.

permalink
report
parent
reply
53 points

It’s not about the crops, farmers work by the sun, not by the clock.

It was able conserving candles and oil, for lighting rooms.

permalink
report
parent
reply
25 points
*

So, this is wrong on so many levels. First of all, DST had nothing to do with farmers, it was to save energy usage in the summer as people were doing more things when the evenings were warmer.

IIRC daylight savings was created way back when electricity really didn’t exist so it allowed the farmers more daylight to harvest their crops.

DST does not increase the amount of daylight on any specific day of the year, it just shifts it later in the day so that people in 8-5 jobs can do more things after work. Farmers don’t work 8-5, they work as needed so if the crops need harvesting they will get harvested based on the weather.

Now with that said there is more technology in today’s farming equipment so DST shouldn’t really exist anymore.

Nowadays farmers have lots of lights and can harvest after the sun goes down, but that has nothing to do with why DST shouldn’t exist. DST shouldn’t exist because it doesn’t save energy due to any populated place having their lights on all night and the actual changing of time leading to negative outcomes like deaths from accidents with no benefits.

Sure, the sun will come up earlier and set later in the summer if we get rid of DST, but the only reason for the time change in the first place was the standard working hours being longer after noon than before.

permalink
report
parent
reply
5 points

My understanding is DST did still save appreciable energy until we replaced incandescent lights with fluorescent and leds. Longer daylight in the evening when people are awake and less in the early morning when people are asleep means lights aren’t being used as much. The average light bulb used to consume 60 watts or more and also let off significant undesirable heat, so with a house full of lights DST really did cut back energy usage. Now though with led lights low consumption and virtually no heat, it’s not nearly as significant.

permalink
report
parent
reply
4 points

and set earlier in the summer*

I hate it. I fucking hate it. With every fiber of my being. I spend every winter counting the days until the sun stops setting before I stop working. Our entire lives are scheduled so we are inside under neon light from 9-6, why are we trying to maximize how much of that is during daytime?

On the day that we go back to permanent ST I will turn to hard drugs to make up for the dopamine deficiency. No joke very few things in my life fill me with more dread than having to suffer early evenings for the rest of my life.

permalink
report
parent
reply
3 points
*

And you’d think *if anything farmers would want more sunlight in the morning when it’s cooler.

Edited because people want to take this the wrong way. As in this another reason that DST and farmers makes no sense.

permalink
report
parent
reply
1 point
*

Actually DST was a war world one thing to save energy. To not need lighting in the factory.

Look it up you’re both wrong.

It actually was only active during WWI and WW2 until late 60s or early 70s (oil crunch may have brought it back.)

permalink
report
parent
reply
14 points

That’s a misconception. Farmers lobbied heavily against DST. Their work does not abide by the clock; they milk when cows need milking, and they harvest when there’s enough light, no matter what some clock says.

In Europe, DST as we know it now was first introduced by Germany during WW1 to preserve coal, then abandoned after the war, and widely adopted again in the 70s. In the US it was established federally in the 60s.

This is all glossing over a lot of regional differences and older history. But yeah, US farmers were very much against the idea.

permalink
report
parent
reply
3 points
*

I blame Big Ice Cream™.

Those ice cream trucks get an additional hour of daylight to hawk their goods before the children are recalled back inside for supper.

permalink
report
parent
reply
5 points

That is literally the opposite of true.

permalink
report
parent
reply
4 points

It was some worker who wanted more time after work to catch butterflys.

permalink
report
parent
reply
86 points

Worked on a project where devices just magically froze, but only during the month of February!

Turned out the people who had written the firmware had decided to do their own time math to save space and had put in an exception in the code for leap year values. Except instead of February 29th, it kicked in for the whole month. And the math was wrong so you ended up with negative values.

The product was due for launch in March of that year and was headed to manufacturing. It was by sheer luck that someone ran a test on February 1st and caught the problem.

Don’t mess with time in code, kids.

permalink
report
reply
36 points

This is why we have pre-built libraries and Unix time.

permalink
report
parent
reply
20 points

Embedded portable device with a teeny ARM processor. Sadly, no room for linux anything or even an RTC. Every time it connected to a phone, the phone would set its clock so the timestamps were somewhat close to being accurate.

However, if you swapped out the AAA battery and DIDN’T connect it to the phone at least once, all your subsequent readings would go back to zero epoch and would be forgotten 🤷🏻‍♂️

Good times.

permalink
report
parent
reply
11 points

Some absolute and utter legend of a man made a Unix kernel for the fucking ZILOG Z80, you have no excuses

(It’s called UZI and it’s written in K&R C for some obscure CP/M compiler)

permalink
report
parent
reply
4 points
*

Unix time.

Unix time doesn’t help with timezones… It’s always in UTC.

Unix timestamps also get a bit weird because of leap seconds. Unix timestamps have no support for leap seconds (the POSIX spec says a Unix day is always exactly 86400 seconds), so they’re usually implemented by repeating the same timestamp twice. This means that the timestamp is ambiguous for that repeated second - one timestamp actually refers to two different moments in time. To quote the example from Wikipedia:

Unix time numbers are repeated in the second immediately following a positive leap second. The Unix time number 1483142400 is thus ambiguous: it can refer either to start of the leap second (2016-12-31 23:59:60) or the end of it, one second later (2017-01-01 00:00:00). In the theoretical case when a negative leap second occurs, no ambiguity is caused, but instead there is a range of Unix time numbers that do not refer to any point in UTC time at all.

Some systems instead spread a positive leap second across the entire day (making each second a very very tiny bit longer) but technically this violates POSIX since it’s modifying the length of a second.

Aren’t timestamps fun?

Luckily, the standards body that deals with leap seconds has said they’ll be discontinued by 2035, so at least it’s one less thing that developers dealing with timestamps will have to worry about.

Don’t try to write your own date/time code. Just don’t. Use something built by someone else.

permalink
report
parent
reply
3 points

Luckily, the standards body that deals with leap seconds has said they’ll be discontinued by 2035

Did they figure out a way of making the earth spin more reliably per how the humans want it to?

permalink
report
parent
reply
-1 points
*

Unix time doesn’t help with timezones… It’s always in UTC.

Unix timestamp is always in UTC which is why it’s helpful. It’s seconds since Jan 1st 1970 UTC. Libraries let you specify timezone usually if you need to convert from/to a human readable string.

Don’t try to write your own date/time code. Just don’t. Use something built by someone else.

…yes that’s why UNIX timestamps are helpful, because it’s a constant standard across all the libraries.

Some systems instead spread a positive leap second across the entire day (making each second a very very tiny bit longer) but technically this violates POSIX since it’s modifying the length of a second.

Then that system should be trashed.

permalink
report
parent
reply
4 points
*

too bad unix time only has 14 years of life left in it.

Edit: this only applies to 32 bit Unix time. The 64 bit lifespan is a little longer, at 584 billion years. Whoops lol.

permalink
report
parent
reply
5 points

No

permalink
report
parent
reply
2 points

Was it related to banking?

permalink
report
parent
reply
8 points

Consumer health.

Good product, too. Won a bunch of awards. Unfortunately, the company has since gone out of business.

permalink
report
parent
reply
69 points

permalink
report
reply
45 points

permalink
report
parent
reply
43 points
*

Ok so there are 24 time zones. Before that every town had their own time based on the sun. We basically went from infinity time zones down to 24. This is in fact simpler.

(There are some half hour time zones too, (India, Newfoundland) so at least 26.)

permalink
report
reply
25 points

There are a few time zones that are 45 minutes off, like Nepal Standard Time which is UTC+5:45, some places in Western Australia and South Australia use UTC+08:45 and the Chatham Islands are at UTC+12:45 or UTC+13:45 in summer.

permalink
report
parent
reply

DST means you also have things like CST vs CET and given some places start DST earlier or later than others and some ignore it all together, we probably have at least 50 time zones.

Always fun trying to schedule international regular meetings when suddenly there’s a week when half the people’s times changed and the other half’s times haven’t yet, so you try to figure out which time would exclude the fewest essential people.

permalink
report
parent
reply
0 points

Absolute madness. smh my head

permalink
report
parent
reply
10 points

there are 24 time zones

Cunningham’s law says that this will generate some discussion in the replies!

permalink
report
parent
reply
1 point

No, there is entire continuum of time zones.

permalink
report
parent
reply
35 points

Soon we’re going to have a new timezone for the moon. Yay, I guess?

permalink
report
reply
18 points

Surely they will just use utc?

permalink
report
parent
reply
27 points
*

Can’t be that simple due to time dilation effect. Time moves at a different rate in moon, about 1s 58.7 μs difference per day.

https://www.reuters.com/science/white-house-directs-nasa-create-time-standard-moon-2024-04-02/

permalink
report
parent
reply
18 points

That article says 58.7 microseconds per (Earth) day. Not 1s.

permalink
report
parent
reply
6 points

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 5.3K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments