Live data from Hacker News

Falsehoods programmers believe about time and time zones

creativedeletion.com

81–83 of 83 posts

Re: Falsehoods programmers believe about time and time zones

#81
post #49

Earlier quoted context omitted.

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.

> Operating systems kind of suck at it. 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 u…

They might have more resources, but they also have constraints. For instance a tzdata update was just released yesterday. Apple has a lot of resources but I don't see an updated from them today on iOS nor Mac OS X. Elixir tzdata automatically updates to the new version.

Does Apple even have resources that work on tzdata code? Or do they just use open source code?

I wrote more about the issue here: http://www.creativedeletion.com/2015/12/03/timezone-updates-...

In particular for Elixir I trust the time zone data from Tzdata more than for any other language, mostly because I know it is designed to have up to date data. (And well, I know the code because I wrote it myself.)

Even if a system is good in many ways it does not matter if the data is not up to date.

Re: Falsehoods programmers believe about time and time zones

#82
post #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".

Depending on what you need to do, UTC does not always work: http://www.creativedeletion.com/2015/03/19/persisting_future...
Post reply on HN