[tz] [PATCH] Revert recent pre-1970 changes.
Guy Harris
guy at alum.mit.edu
Mon Sep 2 05:18:31 UTC 2013
On Sep 1, 2013, at 4:56 PM, Lester Caine <lester at lsces.co.uk> wrote:
> Guy Harris wrote:
>> Where I'm sitting right now as I type this sentence, the local time is 4:24 PM and the offset from UTC is -7:00.
> And if I apply that offset in 6 months time will I get the right local time?
No, but if you apply the entire time zone database to the problem, you will (assuming the US government doesn't decide to change the daylight savings time rules again).
> How do I find what the right offset should be in 6 months time? I currently don't have enough information.
"man zic", and read the time zone database, and you will then have enough information.
> Easiest way is ask for their location which usually starts with a country code
That requires a map between locations - which obviously have more than just a country code in many cases, given that the ISO 3166 country codes "us" and "ca", for example, correspond to countries that have more than one country code.
> and then we don't have to display the whole list of timezones ? Just a sub-set if required
Yes, it would be a good idea to have a file that maps locations to tzids. Of course, there's "location" as in "location name" (such as "Palo Alto, California, USA" or "Düsseldorf, Germany" (or "Düsseldorf, North Rhine-Westfalia, Germany" if there's more than one "Düsseldorf" in Germany; there *is* more than one "Palo Alto" in the US:
https://en.wikipedia.org/wiki/Palo_Alto_(disambiguation)
).
> ... If I just ask for their 'timezone' then I still need to ask for the country anyway.
Or you can ask for their current longitude and latitude; I suspect that's how my computer figures out the appropriate time zone:
https://developer.apple.com/library/Mac/documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html#//apple_ref/doc/uid/TP40007123
> ( Wouldn't it be nice if the browser returned a timezone rather than a meaningless offset - but I've been asking that one for 10+ years :) )
To which browser are you referring?
More information about the tz
mailing list