Live data from Hacker News

Falsehoods programmers believe about time and time zones

creativedeletion.com

21–30 of 83 posts

Re: Falsehoods programmers believe about time and time zones

#22
post #19

It bothers me that a minute is not always 60 seconds. For leap seconds why did we choose 23:59:60 instead of 24:00:00? If we had went with the latter we also solve the daylight savings time problem. A day would last until 22:59:59 or 24:59:59 depending on the time of year. It seems like a lot of things would be simpler that way. Does anyone have a better understanding of why things ended up this way?

> It bothers me that a minute is not always 60 seconds. For leap seconds why did we choose 23:59:60 instead of 24:00:00?

But how does this solve the problem? Sure, 23:59 is now 60 seconds long, but the minute 24:00 is only 1 second long.

Re: Falsehoods programmers believe about time and time zones

#23

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.

The way I get around this in my head is that UK's timezone is "Europe/London". (my definition of "timezone" is "IANA timezone", so while "UTC" or "GMT" are both valid, they aren't what the UK uses.) The "GMT" or "BST" is just a locale-ish thing that gets tacked on to output, much like "EST" or "EDT" for "America/New_York".

Re: Falsehoods programmers believe about time and time zones

#24
post #13

In 2012, I submitted a Python bug about the bad state of ISO 8601 date parsing in Python. It's still open, after four years of arguments.[1] [1] https://bugs.python.org/issue15873

For those who perhaps don't use Python: what makes this more ridiculous is that Python can output ISO timestamps. But it cannot read them back in.

Thankfully, there are third party libraries that do just this (such as iso8601), but its such a silly dependency to need.

Re: Falsehoods programmers believe about time and time zones

#25
post #21

There is a video by Computerphile ( https://www.youtube.com/watch?v=-5wpm-gesOY ) which in an entertaining way explains time zone problems.

That is one of my all-time favorite youtube videos... This one, and a similar one on unicode[1], are my goto exhibits when I need to illustrate to a non-technical family member how much background complexity is involved in software

[1] https://www.youtube.com/watch?v=MijmeoH9LT4

Re: Falsehoods programmers believe about time and time zones

#26

One 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…

Wow! Good thing that out of habit i always used "UTC".

Re: Falsehoods programmers believe about time and time zones

#27
Would it be too much to have a global movement for uniform time standards? No half-hour timezones, no daylight savings, no leap seconds, just easily predictable time. Calendars are supposed to be convenient, and right now our ancient conventions make it difficult to understand each other (not just computers; think of travelers having to adjust to timezones, "do I need DST or not?"). At least, lets think of the electricity consumed converting date structures.

PS. and while we re at it why not switch time to base-10? And seriously get rid of the imperial units already.

Re: Falsehoods programmers believe about time and time zones

#28

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.

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 based on the Season: Burkina Faso, Côte d'Ivoire, The Gambia, Ghana, Guinea, Guinea-Bissau, Liberia, Mali, Mauritania, Tomé and Príncipe, Senegal, Leone, Togo, Western Sahara (not technically a country but that's unrelated to the currently customary timezone), Greenland, Iceland, Saint Helena, Ascension Island and Tristan da Cunha

Re: Falsehoods programmers believe about time and time zones

#30

Dealing 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

"(Sorry about that, but we can’t show files that are this big right now.)" 1.3MB and it's actually raw code. Amazing.

Daylight Savings Time should die in the fires of hell.
Post reply on HN