Top
Best
New

Posted by move-on-by 1 day ago

Debian 13, Postgres, and the US time zones(rachelbythebay.com)
271 points | 142 commentspage 2
liampulles 1 day ago|
tz-announce is a nice mailing list to subscribe to, useful info and fascinating.

https://lists.iana.org/hyperkitty/list/tz-announce@iana.org/...

reactordev 1 day ago||
Ooofff. The two difficult things in software engineering, naming, and timestamps.

This hit me in the early 2000s and now everything I do is in UTC. All dates, timestamps, everything, UTC. If you want to look at a local window in time, convert the window to a utc start and end date and search. When viewing, use a js function to translate the utc date to a local one to print. The mental gymnasium of local to utc to local again…

dotancohen 1 day ago||

  > The two difficult things in software engineering, naming, and timestamps.
And off-by-one errors. The two most difficult things in software engineering: naming things, timestamps, and off-by-one errors.
TheNewsIsHere 1 day ago||
I see what you did there.
umanwizard 1 day ago||
Some times cannot be expressed in UTC.

For example: “this meeting will take place at 10 AM on July 31st, 2026, US Pacific time” cannot be expressed in UTC. You can guess what time UTC that refers to, and you’ll probably be right, but you’ll be wrong if it turns out for example that the US abolishes DST before that date.

zajio1am 1 day ago||
In that case it is no really a time, it is a condition.
layer8 22 hours ago|||
If the “condition” is what’s important for whatever you want to achieve, then that’s the thing to store.

Moreover, most people in real life will understand that to be a time and won’t care how it maps to UTC.

bmacho 1 day ago|||
Yup, it's a function that leads to a time, depending on some things. And you can't express it in UTC, so you better store the whole function (as a string, for example). QED
nja 1 day ago||
I'm still not totally sure why these names were deprecated in the first place...

I mean, the folks who run the tz db definitely know what they're doing, it just never 100% clicked with my thinking.

I always prefer `US/Eastern` over `America/New_York` -- it seems more "canonical" to me. New York is _currently_ the anchor city for ET, but will it always be? The place I live (Boston) is currently on ET, but in the future it might be on Atlantic Time. If there was an `America/Boston`, I would use that to be safe, but since there isn't, it just seems better to be to be specific that I mean "Eastern Time" and not "whatever the time is in NYC"... At least then if Boston switches to a different tz, I could intentionally switch to "Atlantic Time" -- doesn't that make more sense? Versus I guess what I'd have to do, which is switch to `America/Puerto_Rico`? (I had to actually search that one, too bad there's no `US/Atlantic`...)

themafia 1 day ago||
> the folks who run the tz db definitely know what they're doing

It's one guy. He demonstrably does NOT know what he's doing.

> I always prefer `US/Eastern`

As you should. It's the actual name of the timezone as published by the entity that defines it. Outside of the goofy definitions in the tz file it's what everyone living _inside_ of that timezone would call it and see it referenced as.

To call this "backwards" is an absolute insult to civil time keeping and drives me insane.

> doesn't that make more sense?

I always thought it should be served through DNS. Then each country can just define it's own TZ record type and embed it at the root of their country code domain and could expand on it however they like.

eastern.timezone.us

Also, since domain names have punycode for internationalization, you could actually call timezones in countries like Mexico what they're actually named for end users.

TheNewsIsHere 1 day ago||
This is a fantastic idea.

You could use this to promulgate SRV records that direct you to a country’s authoritative time servers, too.

skydhash 1 day ago|||
If New-York shifts its timezone, then it will still be New-York and America. And the new tzdata will reflect that shift so your data will always be correct (as in reflecting the time it is in new york). For local time, you will switch to a new city and the date will still be correct.
nja 1 day ago||
Exactly, but that is my point: usually my data is not intended to reflect the time it is in New York. Being tied to a (semi-)arbitrary city changes the actual meaning of the zone slightly. If every city was represented and I could choose "Boston" then that would make sense (for data is intended to reflect the time it is in Boston) but of course that's not entirely practical.

(I'll note that I agree with the general wisdom to store data in UTC; here when I talk about zones I'm either talking about user local machine time or display)

umanwizard 1 day ago||
FWIW if Boston switches, it won’t be America/Puerto_Rico, it’ll get a new zone name (probably America/Boston). Tzdb zones express that everywhere in that zone has always been on the same time, since the advent of standard timekeeping, so they always fracture when some subset moves to a different zone.
raziel2p 1 day ago||
> At the time, I went "WTF?" and just commented it out to get it running again. I had bigger fish to fry... and just kind of forgot about it. Everything seemed fine.

You're running a database system and you just casually comment out the configuration setting the timezone?

In what way did everything "seem fine"? SELECT 1 returned something? No further investigation required??

ggm 1 day ago||
Is there a problem with ISO3166 denoted information in general or is there a specific US issue here? I would think ISO code denoted tzdata was a public good in some sense.
mananaysiempre 1 day ago||
This has nothing to do with ISO 3166 at all. The tzdata database is the work of a single person, Arthur Olson, not a committee (or rather it was, from its birth in the 1980s until 2011 when a company decided to sue him for no reason).

And for most of its life it’s been an explicit policy that timezones are named by continent and representative population center, not by country, to avoid entangling it in territorial disputes and improve naming stability for historical data. The US/* (and Canada/*, etc.) names are deprecated and have been since 1995 (?), but apparently people were still using them because the deprecation wasn’t really apparent unless one was especially into reading release notes.

breakingcups 1 day ago||
Interesting, I hadn't heard about that frivolous lawsuit before: https://www.eff.org/press/releases/eff-wins-protection-time-...
masklinn 1 day ago|||
All the legacy time zones were moved out of the default zoneinfo install. It’s not a us-specific issue but the legacy US/ timezones remain in widespread use, and they stop working on Debian 13 ootb (possibly Ubuntu noble as well?).
pixelesque 1 day ago|||
Does anyone know why they are still in widespread use?

Config defaults somewhere still using them? Man page examples? Tutorials using them? Or just force of habit?

zahlman 1 day ago|||
> Does anyone know why they are still in widespread use?

Because of a lack of things compelling people to change them until it causes a breakage. And then when it does cause a breakage, most people would rather move heaven and earth to complain, research workarounds, etc. rather than just change it. (Institutional structures can also make "just" changing it far harder than that should be.)

acdha 1 day ago||||
There’s definitely inertia but I think it’s also that the US/ names match official usage: nobody, not even residents, says the time zone is New York because the official name is Eastern time.
cpburns2009 1 day ago||
Exactly this. I still don't know if there's a technical difference between America/New_York, America/Detroit, or America/Indianapolis.
umanwizard 1 day ago||
America/Detroit is different from America/New_York on times before 1915 (when Detroit switched from Central to Eastern Time).
rtpg 1 day ago||||
Some of this is surely just muscle memory or intertia as well. I remember random config values from when I was trying out linux boxes back in high school that I replicated into files that just don't get touched for decades afterwards.

When was the last time you rebuilt your company's postgres config from scratch?

Symbiote 1 day ago|||
> When was the last time you rebuilt your company's postgres config from scratch?

Last year, when we upgrade to version 17.

I looked at the example/template configuration, diffed it with our configuration from PG15, and for every change decided whether to keep our version or the new setting.

I didn't use it, but Debian/APT has had a tool to do this sort of comparison for any software upgrade for as long as I can remember.

Do other people just copy the old config and shout "YOLO!"?

magicalhippo 1 day ago|||
Still typing "nano -w filename" each and every time since back around y2k when I was working on Linux for the first time I was told that bad things could happen if I didn't...
fredoralive 1 day ago||||
I suspect some of it will be because the legacy form is a bit more intuitive than the standard form. You don’t really use continents and cities as a reference to time zones normally, countries and local subdivisions makes more sense, but as other people note, it brings up POLITICS.
MartijnBraam 1 day ago||
You don't use them normally in the US, I've been referring to europe/amsterdam or europe/paris all my life in Linux installers and various equipment. I've never ever encountered netherlands/amsterdam or something like that.
Symbiote 1 day ago|||
From the list of deprecated zones, we could have been using "GB", "Poland", "Portugal", "CET", but that's about it. "Netherlands" didn't exist.

Given the old names were deprecated in 1993, it's hardly surprising that I never before discovered "GB".

umanwizard 1 day ago|||
It’s the same in Europe as it is in the US. Normal people refer to Europe/Paris as CET, just like normal people refer to America/New_York as Eastern Time.
Macha 1 day ago|||
I wonder how much of an influence it is that US/Eastern is easier to type than America/New_York
pdw 1 day ago|||
Are they in widespread use? They were deprecated in 1995.
ahoef 1 day ago||
I don't see conflict in those statements.
evdubs 1 day ago||
You can see the zones that are deprecated at https://packages.debian.org/sid/all/tzdata-legacy/filelist
loloquwowndueo 1 day ago||
Imagine my outrage when America/Montreal was deprecated years ago. “It’s the same as America/Toronto, just use that” they said :)
ta1243 1 day ago|
Have Montreal and Toronto ever been in different timezones?
loloquwowndueo 1 day ago||
No they have not. But why not nix Toronto instead? Everybody knows Montreal is better, it should get dibs at naming the time zone.

I’m just joking all the way, by the way :)

ta1243 1 day ago||
Toronto's bigger. Same reason Boston and Washington are "New York" and Seatle/SanFrancisco are Los_Angeles

(Detroit gets its own zone because it was significantly different to new york before 1970, normally it's only difference post 1970 which merit a new zone)

loloquwowndueo 1 day ago||
Montreal is older! Montreal was there first! Montreal was once Canada’s capital!

You did read the “I’m just joking” in my previous post, right? I don’t give a shit as long as I can select a city in my country and time zone :)

donalhunt 1 day ago||
What sort of monster are you by not defaulting to UTC on systems? (⊙_⊙') /s
raverbashing 1 day ago||
[flagged]
rlpb 1 day ago|
The timezone names are defined by the Olson database, not Debian. It is the only sensible system in our ecosystem. It certainly beats Outlook which still wrongly insists that my timezone is GMT just because I live in the UK and still confuses everyone (it isn't during the summer; we use BST over the summer, not GMT).
arielcostas 1 day ago|||
> It is the only sensible system in our ecosystem. It certainly beats Outlook which still wrongly insists that my timezone is GMT just because I live in the UK and still confuses everyone (it isn't during the summer; we use BST over the summer, not GMT).

I went to both Outlook and Teams to check and I have the option to select both "(UTC) Universal Coordinated Time" and "(UTC+0) Dublin, Edinburgh, Lisbon, London", with the later adapting to changes in the summer; but I do agree it's clunkier than the Olson database, combining multiple regions in a single option while splitting regions with the same timezone rules into different ones.

rlpb 1 day ago||
> ...I have the option to select..."(UTC+0) Dublin, Edinburgh, Lisbon, London"

This is factually wrong already. In summer, London is not UTC+0. They mean "UTC+0 ignoring DST", but that is not useful. If they're going to be specific by specifying a UTC offset, what's the point if it doesn't include DST? How is that useful as an identifier when it's ambiguous? With their history of getting it wrong, this just introduces doubt about its correctness.

Further, if you ask Outlook to show you two timezones at once and do not override labels, it will label BST "UTC+0" (it isn't; it's UTC+1!) while also calling eg. India "UTC+5:30", implying a time difference of 5.5 hours when it is actually 4.5 hours. This isn't just a case of "ah - they actually mean ..."; it's most definitely wrong!

The problem is that it has a very US-centric view of what DST is. You can mostly ignore it in the US when calculating time zones because the entire country changes DST at the same time. This is not the case internationally.

arielcostas 1 day ago|||
> This is factually wrong already. In summer, London is not UTC+0.

Yeah, the "regular" time is UTC+0, with it changing in the summer. I'm aware it's a really poor implementation, but it is there as a separate option from "UTC" itself preserving the same offset (0) all year.

> The problem is that it has a very US-centric view of what DST is. You can mostly ignore it in the US when calculating time zones because the entire country changes DST at the same time. This is not the case internationally.

Probably the reason they, for some reason, split the setting for "Amsterdam, Bern, Berlin, Rome, Stockholm, Vienna" and "Brussels, Copenhaguen, Madrid, Paris" even though they all follow the same timezone and change simultaneously.

raverbashing 1 day ago|||
> In summer, London is not UTC+0. They mean "UTC+0 ignoring DST", but that is not useful

This is how 99% of people interpret it

It's not ambiguous as you imply.

Summer time is not the default time

I don't know enough about the India case to know how/why it's wrong though

donalhunt 1 day ago||
Tell that to Ireland where we observe Irish Standard Time during the summer (and GMT during the winter).
raverbashing 1 day ago||
Tell what? Nobody cares, because everybody knows what is being said

Your TZ doesn't change between summer and winter. What changes is the shift

I literally didn't see anybody getting confused with this in any country (yes, including Ireland) with summer time.

But some people think they're too smart when they nitpick about minor issues

rlpb 1 day ago||
> Your TZ doesn't change between summer and winter. What changes is the shift

My TZ is GMT in winter and BST in summer. I am not in GMT in summer. GMT continues to exist in summer, doesn't shift but my clock doesn't follow it.

The UTC "shift" changes indeed. When I am DST-shifted, calling me "UTC" is absolutely wrong.

The practical issue is that people still use "UTC" and "GMT" interchangeably, which is roughly correct anyway since they remain the same in practice. But then during summer when someone says GMT I don't know if they actually mean BST (they mean my local time) or UTC (they mean the global point of reference). That ambiguity only arises because Outlook (and you, apparently) conflate GMT and BST. It's far more of a problem for those actually living in a UTC-adjacent time zone (do you?), especially because being only one hour off, usually both options seem equally likely in context.

raverbashing 1 day ago|||
Any moderately reasonable system would be backwards compatible and/or migrate existing values

> The worst part about this is that it didn't get so much as a mention in the Debian 13 release notes. I read through that document before going for it and never encountered it. Indeed, even now, you won't find "tzdata" or "zone" in it.

lexicality 1 day ago|||
It's been backwards compatible for 30 years, you've had plenty of time to migrate
lmm 1 day ago||
Did it give any noticeable deprecation warning? If a piece of functionality is deprecated but users can't notice, is it really deprecated?
zahlman 1 day ago|||
How and where, in principle, do you suppose it should (be able to) do so, given the functionality? It's just localizing timestamps, and the result might bubble through multiple layers of software before being presented to anyone. It's not as if C APIs get designed up front to return structures with a boolean "btw you called this in a nonstandard way that might fuck up in the future" flag (or, say, a pointer to a deprecation-warning structure; and then that interface has to be rock-solid stable to be of use) for every call. And if they did, nobody would ever write code that checks it.
lmm 1 day ago||
> How and where, in principle, do you suppose it should (be able to) do so, given the functionality?

System logs?

> It's not as if C APIs get designed up front to return structures with a boolean "btw you called this in a nonstandard way that might fuck up in the future" flag (or, say, a pointer to a deprecation-warning structure; and then that interface has to be rock-solid stable to be of use) for every call. And if they did, nobody would ever write code that checks it.

Yeah, fair point, no-one should be using a C API at this point.

lexicality 1 day ago|||
> “Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard’.”

The timezones are very clearly marked as deprecated on the lists I looked at, but on the other hand I don't live in the USA so I've never had to look particularly hard. Everything I configure is either Etc/UTC or Europe/London which is nice and easy to remember...

ars 1 day ago|||
> Any moderately reasonable system would be backwards compatible

It is. Install: tzdata-legacy

1oooqooq 1 day ago||
love the takes on this one blog, but "I'm copying an old conf file for over 20yrs and now got this issue" is kinda weak.

American exceptionalism time zones aren't used since the 90s. even the cpus from that time are already dropped from kernel support. heck even the text encoding is gone.

kstrauser 1 day ago|
That’s unkind. I want to do the right thing in such cases, but I’m also learning about this today for the very first time. I’ve never, not once, heard that US/Pacific was a bad idea until this post. If not for this, I still wouldn’t know. I thought it and America/Los_Angeles were semantically identically and just kind of symlinks to PST8PDT or whatever.

If anything, the city TZ always felt off, like I was opting in to that specific city’s strange legal decisions or something.

Symbiote 1 day ago|||
For general user interfaces, it's for the user interface to show "US Pacific" or "UK" rather than America/Los_Angeles and Europe/London.

The timezone selector in KDE shows "Los Angeles | America/United States of America | Pacific" and "London | Europe/United Kingdom", for example.

1oooqooq 23 hours ago|||
> If anything, the city TZ always felt off, like I was opting in to that specific city’s strange legal decisions or something.

that is exactly what time zones are for :) not being snarky (wasn't before either, i really love that blog!). but the whole reason for tz is to join the ever changing oddities of political bodies from one very specific region.

kstrauser 23 hours ago||
My point there was that it feels hyperlocal to Los Angeles. Does it have some TZ law my own city in the same zone doesn’t? Hope not!

(It doesn’t, but that’s what it implies to me.)

layer8 22 hours ago||
The geographic extent of legislative time zones can change, they can morph, split and merge, and also appear and vanish completely. In consequence, the only way to unambiguously specify which local time results when adding durations backwards and forwards in time, without being constrained to limited periods of legislative non-change, is to fix a specific geographical location, and to specify how local time has changed and is changing at that particular location. That is what the tz database does. In principle, you could define a separate time zone for each point on Earth, but that isn’t practical. So the compromise is to pick representative cities.

One important thing to understand is that the time zones of the tz database, and hence generally the time zones used in computing, are a slightly different concept than legislative time zones.

kstrauser 17 hours ago||
I get all that, I really do. And I know America/LA is a reasonable pick: it’s a large, well known city nearby that’s always going to be at the same time I am when I’m at home.

Still feels weird, though. What if LA specifically passes a time zone law so that now it’s sometimes wrong for everyone else in California. Do we add an America/Cali_except_LA zone?

That’s probably hypothetical. It seems unlikely. But what a major pain in the ass if it did happen?

layer8 5 hours ago|||
Another city would be picked to represent the rest of California, and the point is that using that city as a time zone ID would then work not only for future times, but also backwards for any times in the past. If, instead, you had America/California, or US/Pacific, those would be ambiguous either forward or backwards in time.

So the trade-off is timezones being specific to a particular city but remaining unambiguous forward and backward in time.

You can’t avoid pain when there is a change in the geographic area of a legislative time zone. But you can avoid the case of a time zone ID becoming ambiguous in terms of the UTC<—>local time mapping it’s supposed to define. The latter is the aim of the present scheme.

arcfour 15 hours ago|||
That can happen and has. And the result is basically as you described it.

Yes, it's silly and inefficient, but so are time zones. It's not an easy problem to wrangle on a computer, for reasons that are exactly as you have described.

kstrauser 12 hours ago||
Yeah, it’s easy enough to pick at edge cases, but it’s amazing we have something that generally works this well at all. I don’t know if I have any better ideas, at least ones that the smart people maintaining the DB haven’t already considered and rejected.

It’s an inherently complex, ugly mess.

pfexec 1 day ago|
Debian is known to have made similar monstrously stupid decisions.

For example, they patch OpenSSH source code in a way that makes defaults behave differently than upstream. In the name of backwards compatibility of course.

I assume this will continue until it doesn't anymore, and the only notification you shall receive from the ivory tower is a cryptic one-liner buried in a changelog somewhere.

traceroute66 1 day ago||
> For example, they patch OpenSSH source code in a way that...

Isn't it the same thing with the RedHat downstreams ? (Not necessarily OpenSSH but other packages)

IIRC RedHat do all sorts of things to keep their gov / corp customers happy, also usually in the name of backwards compatability, all of which then end up in the downstreams.

burnt-resistor 1 day ago||
Russ Allbery left over bureaucracy and systemd. It sounds like it's chocked full of people who want power and an excuse to patch downstream to create a cottage industry of quirks, busywork, and codependency.

I prefer real choice and light patches that try to upstream as much as possible, or workaround upstream obstinacy rather than create incompatible idiosyncrasies. One area that isn't well represented in barely a/no distro is init freedom neither married to nor completely divorced from the sprawling octopus.

joeyh 1 day ago|||
You are confusing Russ Allbery with me, while at the same time making it sound like I have a problem with systemd, which is not the case. Russ remains a debian developer.
burnt-resistor 23 hours ago||
No, I don't think so but perhaps it wasn't as drastic: https://lwn.net/Articles/620879/

Also, I worked in the same department as Russ once upon a time in a galaxy far, far away.

actionfromafar 1 day ago|||
I don't think you can be partly married to Cuthulhu. (Systemd.)
styanax 1 day ago||
[ eldritch noises intensify ]

As an actual answer, it's not too bad on Debian; we only really use/need: systemd (system and user), -logind, -journald, -udevd. All in all, not too many tentacles but there are a few...