I'm ok with timezones, but the guy who invented daylight savings time I'd slap to all the way to the sun
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.
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.
Switching sucks but DST is better than Standard Time.
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.
It's easy, the good part is DST (which is what we're currently in - Spring through Fall in the northern hemisphere).
Love me some early evening daylight though. Nice warm but not hot cruise/drive with the windows and the top down on the car.
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.
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.)
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.
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.
there are 24 time zones
Cunningham's law says that this will generate some discussion in the replies!
not a programmer myself, but actually fuck you, UTC was the correct choice, anything that isn't UTC is a wrong choice, and i will literally fight to my death over this.
Timezones are dumb and stupid, and you cannot convince me otherwise, so far the single best argument i've heard is "well actually, the hands on a clock and the numbers themselves roughly represent the cycle of the sun in the sky during the day." Which is pretty good, until you realize that clocks tend to be circles, and you can often just rotate them. And suddenly, the numbers now match up perfectly. But i've also never once heard of someone caring about that specific feature, so uh. Good riddance frankly.
Timezones kind of made sense back in the day, when the sun was the only realistic timing system, and pre internet, when people stayed where they were. But now that people don't do that, and the internet tends to do this thing where it exists. I refuse to believe it makes more sense to have timezones than not.
"Hmmm yes please, i would like to order the time here, but halfway across the globe please" - statements dreamed up by the utterly insane.
ok that concludes my rant. Now i'm going to go set FUCKING DAYLIGHT SAVINGS TIME on my clock because FOR SOME REASON THE TIME JUST CHANGES HALFWAY THROUGH THE YEAR FUCK YOU.
Soon we're going to have a new timezone for the moon. Yay, I guess?
Surely they will just use utc?
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/
That article says 58.7 microseconds per (Earth) day. Not 1s.
Shit you're right, I misremembered it.
Appreciate you correcting your post, just one more needed.
ms = milliseconds
us = microseconds
The guy that invented time zones was solving a problem where each little town had their own time standard. I don't think that was sustainable.
I used to feel this way. Over the course of building out 2 calendar systems in my career (so far) and having to learn the intricacies of date and time-related data types and how they interact with time zones, I don’t have much disdain for time zones. I’d suggest for anyone who feels the same way as this meme read So You Want To Abolish Time Zones.
Also, programmers tend to get frustrated with time zones when they run into bugs around time zone conversion. This is almost always due to the code being written in a way that disregards the existence of times zones until it’s needed and then tacks on the time zone handling as an afterthought.
If any code that deals with time takes the full complexities of time zones into account from the get-go (which isn’t that hard to do), then it’s pretty straightforward to manage.
This did little to convince me that timezones are an unnecessary construct. Pretty much every point made was done from the perspective of someone who had already decided their opinion rather than objectively weighing the pros and cons.
Before timezones and trains, each town had its own natural time (based on the sun or whatever). Would you have preferred that?
Cool, so sunrise is at 8 PM now. Or maybe there's just no consistent relationship between what a clock on the East and West coast of America say, and a call can't be scheduled between them.
The real problem with time and date is that it has to fit social and natural systems as well as actual passage of time. A lot of nuance is unavoidable.
Yeah, tbh the "no timezones" approach comes with its own basket of problems that isn't necessarily better than the "with timezones" basket. The system needed to find a balance between being useful locally, but intelligible across regions. Especially challenging before ubiquitous telecommunications
Imagine having to rethink the social norms around time every time you travel or meet someone from far away. They say "Oh I work a 9-to-5 office job" and then you need to figure out where they live to understand what that means. Or a doctor writes a book where they recommend that you get to bed by 2:00PM every night, and then you need to figure out how to translate that to a time that makes sense for you.
We'd invent and use informal timezones anyway, and then we'd be writing Javascript functions to translate "real" times to "colloquial" times, and that's pretty close to just storing datetimes in UTC then translating them to a relevant timezone ad hoc, which is what we're already doing.
That's what my rational programmer brain says. My emotional programmer brain is exactly this meme.
Cool, so sunrise is at 8 PM now.
And the problem with that is... ?
Or maybe there’s just no consistent relationship between what a clock on the East and West coast of America say, and a call can’t be scheduled between them.
If you get rid of timezones they all say the same time, no? If you want to schedule a call you just say the time and save the timzone offset fiddling.
The real problem with time and date is that it has to fit social and natural systems as well as actual passage of time.
Can you give any more concrete examples? None come to mind beyond habit, which is not an immutable thing.
Here's a quick essay about the problems with it.
TL;DR - as long as people generally prefer to sleep when it's dark and wake when it's light (and they always will in general) time zones are basically needed as a form of lookup table for when to try to communicate with other places.
And the problem with that is… ?
The problem is that the date changes in the middle of the day. 00:00 ("midnight") should occur around the middle of the night, so that one day (sunrise to sunset) has a single date assigned to it.
In my opinion it would make more sense to set 00:00 at slightly before sunrise (roughly 4:00 by my clock), that way one night "belongs" to the day that preceded it. But for whatever reason they decided that the date changes in the middle of the night. That's fine. Middle of the day would not be fine.
Edit: hey cool, Japan kinda agrees with me! https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japan#Time
Yes! Very much so.
This is a good illustration of exactly why timezones exist and the issues with not having them.
I've just said 'fuck it' and switched all my clocks to UTC. I don't even care anymore.
But if time travel is a thing, imagine the whole new time nightmares! Oh you went back a year with your phone? Now all your TLS root certs are invalid because you're before the start date. Or you have files/emails/whatever that are dated in the future. I guess you can get to that state by just setting your clock forward but I imagine some stuff would break.
I once developed an electronic program guide for a cable TV company in New Zealand and I'd lose my mind if I had to use timezones. The basic rule of thumb was:
a) Internally you use UTC religiously. UTC is the same everywhere on Earth, time always goes forward, most languages have classes that represent instants, durations etc. In addition you make damned sure your server time is correct and UTC.
b) You only deal with timezones when presenting something to a user or taking input from a user
Prior to that I had worked for a US trading company that set all their servers to EST and was receiving trades through the system which expressed time & date ambiguously. Just had to assume everywhere that EST was the default but it was just dumb programming and I bet to this day every piece of code they develop has time bugs.
Except if there was only one zone of time that would be hell to program too because then you would need to check for different times of day for different locations. I think programming is just difficult lol
you would need to check for different times of day for different locations
You have to do that now with time zones anyway.
I think the comment was more about phases of the day. Like for example, your phone might come pre-installed with a sleep mode from 23:00 to 06:00, which roughly fits for most users. Should we use UTC everywhere, then you'd have to have different presets for different parts of the globe.
Or say you wake up just a bit after sunrise at 7am everyday and you fly across the continent for vacation. Now you have to change all your alarms because sunrise is suddenly at 3am.
Or what if you're writing a book and you want to tell the reader what time it is: 15:00 will mean something else to readers around the world. And while you could attempt to cover it up with "15:00 in the afternoon", there will still be a disconnect between your words/intentions and what the reader pictures.
UTC would be a bliss for programming and scheduling events in this funny little globalized world, but as animals we still base our days on the burning fireball in the sky and removing that connotation from our timekeeping messes with linguistics and clear communication.
I don't think the system we have is perfect either, but I don't think employing UTC everywhere is the way and I don't have other suggestion either.
and then boom congratulations you just reinvented time zones except worse, & everyone's gonna do their own way and they're all gonna be slightly different.
but at least your code will be simpler. oh, wait...
The only code with timezones should be the bit squishy meat bags touch. Everything's is should be UNIX time. Or it you are unfortunate enough to be on Windows, NT time.
Some unfortunate programmers already have to deal with the speed of time not being a constant. In a distant future, timestamps might always have a universal position (and speed), and is that much different from timezones?
Or we find some way of removing time distortion of physics. Find the universe's real systick. 😃
If only I had a numeric type that could hold the value of how many seconds since the creation of the Universe, without overflowing, I'd be set.
Programmer Humor
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