Live data from Hacker News

News for the tz database

github.com

11–20 of 29 posts

Re: News for the tz database

#11

> Use "PST" and "PDT" for Philippine time. I wonder if this will break anything. Some systems make the bad assumption that timezone abbreviations are unique, e.g. when parsing dates.

And the "changes to past timestamps" is why you can't even store past events using Olson timezone names like America/Los_Angeles: you have to use UTC and/or timezone offsets like -0700.

https://en.m.wikipedia.org/wiki/Tz_database https://news.ycombinator.com/item?id=10032498

Re: News for the tz database

#12
They're removing East Saskatchewan? That was my favourite nonsense time zone. They're right that it should have been "West Saskatchewan", but I suppose Saskatchewan on its own is enough for the province outside Lloydminster, and Lloydminster uses Alberta (Mountain) time anyways which makes a second Saskatchewan timezones redundant (for now).

Re: News for the tz database

#13

> Use "PST" and "PDT" for Philippine time. I wonder if this will break anything. Some systems make the bad assumption that timezone abbreviations are unique, e.g. when parsing dates.

And the "changes to past timestamps" is why you can't even store past events using Olson timezone names like America/Los_Angeles: you have to use UTC and/or timezone offsets like -0700. https://en.m.wikipedia.org/wiki/Tz_database https://news.ycombinator.com/item?id=10032498

Is it not the opposite, though? If you need to store the fact that an important meeting took place in Los Angeles at exactly 4.00pm on a specific date, if you had used utc/offsets, it would look like the meeting took place at 3.59.50pm or whatever change was done to correct the tz data for historical timezones?

Re: News for the tz database

#14
This is like catnip to me. There's a tiny little critical corner of the Internet where dedicated volunteers bust their tails to make sure they get the details excruciatingly correct.

It's also a useful reminder to never, ever attempt to do datetime math on your own. Always use a library! And if that library is buggy, submit patches but don't say "aww, I'll just do it myself".

Re: News for the tz database

#15
post #5

Does every Docker container, snap, flatpack etc. need to be updated every time the tz database releases a new update? Do they?

On my fleet I simply bind-mount /etc/timezone and /etc/localtime from the host (the latter sourced from /usr/share/zoneinfo/Europe/Berlin).

Biggest benefit: the timestamps in logfiles are actually correct and make sense.

Re: News for the tz database

#16

> Use "PST" and "PDT" for Philippine time. I wonder if this will break anything. Some systems make the bad assumption that timezone abbreviations are unique, e.g. when parsing dates.

There were already many duplicate abbreviations, so this isn't a new problem, and as you said, is a bad assumption, those systems would likely already be incorrect. I would guess systems using abbreviations like this presumably are using POSIX timezones, which isn't going to be historically correct, but require defining all the information about the abbreviation/zone anyway (i.e. they are basically made up timezones, so it shouldn't matter).

Re: News for the tz database

#17
post #13

Earlier quoted context omitted.

And the "changes to past timestamps" is why you can't even store past events using Olson timezone names like America/Los_Angeles: you have to use UTC and/or timezone offsets like -0700. https://en.m.wikipedia.org/wiki/Tz_database https://news.ycombinator.com/item?id=10032498

Is it not the opposite, though? If you need to store the fact that an important meeting took place in Los Angeles at exactly 4.00pm on a specific date, if you had used utc/offsets, it would look like the meeting took place at 3.59.50pm or whatever change was done to correct the tz data for historical timezones?

A timestamp should not be used to record location.

Re: News for the tz database

#18
post #13

Earlier quoted context omitted.

And the "changes to past timestamps" is why you can't even store past events using Olson timezone names like America/Los_Angeles: you have to use UTC and/or timezone offsets like -0700. https://en.m.wikipedia.org/wiki/Tz_database https://news.ycombinator.com/item?id=10032498

Is it not the opposite, though? If you need to store the fact that an important meeting took place in Los Angeles at exactly 4.00pm on a specific date, if you had used utc/offsets, it would look like the meeting took place at 3.59.50pm or whatever change was done to correct the tz data for historical timezones?

It really depends on the use-case. If you had a meeting at a specific wall-time you'll want the timestamp to change. If you recorded a timestamp for when something happened, the local time should change.

But you should under no circumstances record the offset. Record either a timestamp or local time + location.

Re: News for the tz database

#19
post #13

Earlier quoted context omitted.

And the "changes to past timestamps" is why you can't even store past events using Olson timezone names like America/Los_Angeles: you have to use UTC and/or timezone offsets like -0700. https://en.m.wikipedia.org/wiki/Tz_database https://news.ycombinator.com/item?id=10032498

Is it not the opposite, though? If you need to store the fact that an important meeting took place in Los Angeles at exactly 4.00pm on a specific date, if you had used utc/offsets, it would look like the meeting took place at 3.59.50pm or whatever change was done to correct the tz data for historical timezones?

As an extreme example, imagine everyone thought daylight saving was going to happen on March 11.

But at the last minute, the government announces it's happening on March 4. And your systems haven't yet been updated to reflect this.

So humans move their clocks forward one hour on March 4.

You write somewhere in a text field "March 4 4pm".

"March 4 4pm America/Los_Angeles" doesn't help you, because it's not clear whether you thought "America/Los_Angeles" was -0800 or -0700. And it's not clear whether the system interpreting that date agrees with you.

To be unambiguous, you need to say "March 4 4pm -0700". Otherwise the system might assume the effective timezone is -0800, per the rules it knows. Without unambiguous input, correctly parsing such times is impossible.

You could also use Olson timezones for past events, but then you'd also have to record which version of the timezone rules you were using. And of course nobody does that because it's overcomplicated and unnecessary.

You're right that converting back to 4pm for display is problematic. The simplest solution is to always display UTC. But if you want to convert to the user's preferred timezone, during this time, yes, the system would display 3pm until it got the updated timezone rules. There are more complex solutions, but for most use cases just displaying "March 4 3pm -0800" would be adequate.

Re: News for the tz database

#20
post #18
post #13

Earlier quoted context omitted.

Is it not the opposite, though? If you need to store the fact that an important meeting took place in Los Angeles at exactly 4.00pm on a specific date, if you had used utc/offsets, it would look like the meeting took place at 3.59.50pm or whatever change was done to correct the tz data for historical timezones?

It really depends on the use-case. If you had a meeting at a specific wall-time you'll want the timestamp to change. If you recorded a timestamp for when something happened, the local time should change. But you should under no circumstances record the offset. Record either a timestamp or local time + location.

I agree that systems should record times in UTC. But I'm talking about a more nuanced edge case: parsing user-entered date strings. If a user says "4pm Los Angeles", it could be ambiguous, and recording the offset is the only way to reliably disambiguate. See my reply above.
Post reply on HN