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.
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.)
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.
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.
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.
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
The UK press every year makes a huge song and dance in opinion pieces about getting rid of DST. However I'm always horrified to see that people want us to keep British Summer Time instead of Grenwich Mean Time. I understand that there are "longer evenings" in BST; however we literally invented GMT and coerced the rest of the world to adjust their times based on that. From the point of view of being constantly compatible with UTC and having more consistent business hours for international companies it makes more sense to me if we kept GMT.
Also the longer evenings thing can be achieved by simply staying up an hour later. It's not exactly like an hour is being stolen from you when the times switch, the change of clocks are mainly pointless admin.
Lastly I read an article recently that described a correlation between the incidence of heart attacks and the clocks changing. The theory is that just slightly messing with people's sleeping patterns can cause additional strain on the body.
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. 😃
I just discovered that while the ServiceNow APIs return all times in UTC, they use the user's default time for all times passed in as a parameter.
So if your account is set up in PDT and you say "give me this item that I just created", it will say "here your item, this was created at 17:00".
But if you say, "cool let me see all items created in the last hour, so anything greater than 16:00", then it will respond "got nothing for ya, chief."
There are some time libraries which actually work pretty well and allow you to manage things like Timezones. And then there are some abominations beyond my compression…
I would have stern words with John Riccitiello the ex Unity CEO who really neglected the core of their business for the years he was there. He was fired not too long ago. Games from scratch covered the conclusion of that train wreck. The new CEO seems to get that they need to refocus on the engine and making it better for developers versus chasing money. https://youtu.be/woTLLrgywwE?si=BIXTJGGMjpjv72vO
I identify as a time radical. We should switch the entire world onto GMT; +/- not a goddamn thing. Is it perfect? I think so, but all those people who might be confused will probably find it a lot less confusing than trying to make sense of the difference between timezones.