This is why we should ignore time zones as much as possible. UTC is almost OK, except for the shitshow idiocy of leap seconds. There's no reason for all of us to suffer just so astronomers can use civil time.
Falsehoods programmers believe about time and time zones
51–60 of 83 posts
Re: Falsehoods programmers believe about time and time zones
#52Regarding daylight savings time, Arizona doesn't observe DST but the Navajo Nation region in Arizona does but inside that is a region that doesn't observe DST.
Re: Falsehoods programmers believe about time and time zones
#53Earlier quoted context omitted.
Daylight Savings Time should die in the fires of hell.
I couldn't agree more - to boot, DST going away solves like half of the edge cases with one quick fix.
Re: Falsehoods programmers believe about time and time zones
#54* Time zone (/DST) changes are always announced well in advance. * Time zone (/DST) changes are always announced in advance.
Yeah, so US announcing DST changes in 2005 that would take effect in 2007 is unusually long compared to most DST changes. A lot of Middle Eastern countries change DST based on the start of Ramadan, which doesn't officially start until someone actually observes the phase of the moon. While you could calculate this from well-known astronomical principles, there ends up being several different ways to handle corner cases which leads to several Islamic calendars in practice. This means that changes can end up being very last minute--a few years ago, the Olsen database wasn't updated for Egypt's DST changes until after they took effect, and there appears to have been a case or two in history where the actual official declaration of the change was, in effect, retroactive.
* 12 AM/12 PM are unambiguous. * Days, weeks, months, and years all start on consistent patterns.
Well, everything is largely consistent in modern civil time reckoning based on the Gregorian calendar, but it's very definitely not the case if you look back as recently as a few decades ago or think about other times. Julian dates start at noon. Particularly in medieval times, the start of the year might be December 25 or March 25--and the time people switched to January 1 as the consistent start year wasn't necessarily the same as the switch from Julian to Gregorian calendars.
Re: Falsehoods programmers believe about time and time zones
#55I'll add one: "But surely each place only has one DST each year…" Nope. Troll Station in Antarctica has four different settings through the year. Personally since there are only 40 people there I think they should just suck it up and pick two. They are probably causing a lot of software bugs. I know they cost me a couple hours. Edit: Oh crum, I see Morocco suspends DST during Ramadan, so they have four settings too……
Re: Falsehoods programmers believe about time and time zones
#56Re: Falsehoods programmers believe about time and time zones
#57Dealing with timezones and daylight savings time has consumed hundreds of hours of my development time. This seriously should be a standard service of the operating system, not the programming language library. Just look at all the code to deal with it in D (written by Jonathan Davis): https://github.com/dlang/phobos/blob/master/std/datetime.d
Operating systems kind of suck at it. Which is why for Elixir I made Tzdata ( https://github.com/lau/tzdata ) not rely on any timezone information from the operating systems. A feature I would like from operating systems is to tell me the true time during leap seconds. E.g. 23:59:59, 23:59:60, 00:00:00 Instead of repeating 23:59:59 or just pretending the leap second never happens.
In past discussions of leap seconds, it came out that the POSIX standard specifies that no such second as 23:59:60 can exist (by specifying that "one day" consists of exactly 86400 seconds). As I understand things, this is why the erroneous behavior you mention is done.
It is not clear to me why, for the sake of complying with a standard we know to be wrong, we report false information and otherwise do things that we also know are wrong. The obvious approach would seem to be to either change the standard or just ignore it.
Re: Falsehoods programmers believe about time and time zones
#58My bete noir isn't in the list: GMT is only the UK timezone for about half the year. During the Summer, GMT continues to exist, but the UK time is BST.
But, as the Wikipedia page says "the term GMT should not be used for precise purposes" as it has been superseded by various other standards (e.g. UTC, UT1) I've encountered English people who made a fuss about the loss of "God's Magnificent Time", but for better or worse GMT is no longer the official name.
Re: Falsehoods programmers believe about time and time zones
#59Re: Falsehoods programmers believe about time and time zones
#60Earlier quoted context omitted.
It's about consistency. 23:59:60 is introducing a special case to the seconds field which you have to account for. 24:00:00 only adds a second to the day where it naturally should go. I don't redefine what a minute is, a minute is always 60 seconds. You are confusing two separate ideas, displaying a time and finding the difference between two times. Lexically you wouldn't say that minute is 1 second long, you would s…
But then you have a second that doesn't belong to a minute.