Skip to content

Comment on Python Enhancement Proposal 495: Local Time Disambiguationparent

Comments

Isn't it about summer and winter time? I'm pretty sure you're still in the same timezone in those cases.

That said, I don't see the reason for this PEP. You should only store a value in the DB that doesn't change like that, and then when displayed you can change it to fit the local time of the user.

In Britian during the summer we use the BST timezone and during winter we use GMT.

But once again this is one of those "assumptions about time that everyone gets wrong" just because we shift timezones in Britian doesn't necessarily mean that people in other countries do the same - they might just change what the timezone offset is and keep the timezone the same.

Absolutely agree with the "one of those assumptions" bit. See http://infiniteundo.com/post/25326999628/falsehoods-programm... for a great list.

(And related, see https://www.mjt.me.uk/posts/falsehoods-programmers-believe-a... for more about addresses.)

Another great resource is the tz database [0]. It includes some great vignettes as well as the time zone rules:

From Larry M. Smith (2006-04-26) re Wisconsin: http://www.legis.state.wi.us/statutes/Stat0175.pdf ... is currently enforced at the 01:00 time of change. Because the local "bar time" in the state corresponds to 02:00, a number of citations are issued for the "sale of class 'B' alcohol after prohibited hours" within the deviated hour of this change every year....

From Winston Churchill (1934-04-28): It is one of the paradoxes of history that we should owe the boon of summer time, which gives every year to the people of this country between 160 and 170 hours more daylight leisure, to a war which plunged Europe into darkness for four years, and shook the foundations of civilization throughout the world.

[0] http://www.iana.org/time-zones

That's not the way it works in the US at all. We keep the same zone all year long but change the offset and change the name slightly. The zones are geographically based: Eastern, Central, Mountain, and Pacific. They are abbreviated differently depending on whether Daylight Saving is in effect or not, for example Central is either CST (Standard, -06:00) or CDT (Daylight, -05:00).

The important part here is that the API to get a timezone usually doesn't include a Daylight Saving flag. For example pytz would be used as pytz.timezone('US/Central'). There needs to be a process that adjusts the tzinfo object to the proper offset; in pytz this is the localize method, but that's non-standard.

Isn't that just a matter of having your library differentiate the timezones slightly,even if the canonical name is identical for the two different timezones (no matter what the country calls them, they really are different)? Additionally, there are ways to reference the timezone in the local time that are guaranteed to be unique. For example, offset from UTC. 1:15 AM UTC-09 is not the same as 1:15 AM UTC-08.

What localities do you know of that just change the hour and do not have a time zone assigned to deal with it? I'm fairly sure the point of time zones it to track all those changes, and a name would be assigned to deal with it.

But once again this is one of those "assumptions about time that everyone gets wrong" just because we shift timezones in Britian doesn't necessarily mean that people in other countries do the same - they might just change what the timezone offset is and keep the timezone the same.

Well, for a proposed change I'd like to see examples of the actual problem caused. The only example I can see is EST and EDT, which seems to be the same as the UK doing GMT->BST. Same for Andorra.

My question wasn't rhetorical, I was actually asking if there were places that don't do this.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.