My 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.
You are confusing two things. A time zone (e.g. Europe/London) is a geographical region of places always sharing the same time and it does not change at a given location unless time zones come and go. The zone time (e.g. GMT or BST) on the other hand is the time in use in a given time zone at a given point in time and it commonly changes twice a year between normal time and daylight saving time and back. In short, da…
Falsehoods programmers believe about time and time zones
61–70 of 83 posts
Re: Falsehoods programmers believe about time and time zones
#62I hope http://momentjs.com/ is not one of libraries that falls into "Many people write libraries without knowing much about the domain." I have used it many times and it is the best one I have come across. Timezones conversion is super hard, which is the exact reason I rely on libraries rather than trying to reinvent the wheel.
Re: Falsehoods programmers believe about time and time zones
#63Dealing 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.
Sure, but they usually have more resources than programming language teams. Consider all the programming languages on your machine. Can you trust they all did the timezone, with all its nuances, correctly?
Consider something simpler - the trig functions. I've noticed time after time that many language libraries get it wrong, and this is with decades of development. Errors are usually in the form of precision that is lower than it should be, and poor handling of special values like NaN and infinity.
The situation with that is so erratic that with the D programming language we'd write our own trig implementations rather than use the C library ones.
Re: Falsehoods programmers believe about time and time zones
#64This 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.
But Astronomers don't actually use "Civil Time" they tend to use either UTC, TAI, or for the continuation of record keeping over the last several hundred years... 'Terrestrial Time'... None of which match up with any Civil Time anywhere on the world, except UTC which does so only periodically for some European countries, and year round in the following countries which resist the idiocy of shifting their clocks around…
Re: Falsehoods programmers believe about time and time zones
#65Earlier quoted context omitted.
But Astronomers don't actually use "Civil Time" they tend to use either UTC, TAI, or for the continuation of record keeping over the last several hundred years... 'Terrestrial Time'... None of which match up with any Civil Time anywhere on the world, except UTC which does so only periodically for some European countries, and year round in the following countries which resist the idiocy of shifting their clocks around…
Perhaps you might spend a few moments contemplating why those countries in northerly latitudes use DST before calling us all idiots.
Re: Falsehoods programmers believe about time and time zones
#66This actually looks like a subtle type safety and casting problem. Not all time specifications belong to the same type.
Re: Falsehoods programmers believe about time and time zones
#67> If I have a timestamp for a future event, I can convert it to UTC, store it as UTC along with the time zone and be sure that I can reliably convert it back to the correct “wall time” in the future This actually looks like a subtle type safety and casting problem. Not all time specifications belong to the same type.
Re: Falsehoods programmers believe about time and time zones
#68One of the more interesting bugs I've created is in an Elixir program using the (great) Timex[0] library. I realised that for a few particular users, timezones were being inverted when converted (e.g. a user in GMT+5 would behave as if they were in GMT-5 and vice versa). After a lot of time spent proving to myself I was not actually going mad, I opened a Github issue and the library author informed me about one of th…
Hi. I'm the author of the article. And also of Elixir Tzdata and https://github.com/lau/calendar I recommend using Calendar instead of Timex. I'm curious: Why where you using e.g. GMT+5 or GMT-5?
Re: Falsehoods programmers believe about time and time zones
#69I'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……
Made my day.
There is this famous conversation-starter: "If you could enact one law, what would be it?" I always say that I would force the US to ditch imperial units, the Fahrenheit scale, and whatever other wonky specialties they've come up with that just confuse programmers everywhere.
Also, let's get rid of DST entirely.
Re: Falsehoods programmers believe about time and time zones
#70I would add most programmers don't know some time zones have offsets in minutes. In ancient times, some were in seconds. I live in UTC-04:30 and regularly encounter bugs because of it.
Until the unified timezone happened, timetables would be printed with multiple timezone information. So maybe your train would depart in Dresden at exactly 14:00 Saxonian time, take exactly three hours to drive to Berlin, and arrive there at 17:06 Prussian time.