[tz] [PATCH 0/1] Add Asia/Beijing

David Patte ₯ dpatte at relativedata.com
Mon Aug 13 21:25:47 UTC 2012


On 2012-08-13 16:39, Guy Harris wrote:
> On Aug 13, 2012, at 12:49 PM, James M Leddy wrote:
>
>> * The common proposed fix is that we should be using "human
>>    presentable" names and have a mapping from these names to the
>>    actual timezones. Since that proposal, indeed since the inception
>>    of desktop Linux/Unix, no one (as far as I know) has actually done
>>    this,
> The desktop (well, laptop) Un*x[*] I'm running will, if I open System Preferences, disable "Set time zone automatically using current location", and drag the little blue location dot over towards China, offer a Time Zone of "China Standard Time" and list a number of cities in the drop-down list, including "Beijing - China" - and symlinks /etc/localtime to /usr/share/zoneinfo/Asia/Harbin.
>
> The map it displays has "Geonames.org" on it.
>
> 	http://www.geonames.org
>
> says "The GeoNames geographical database covers all countries and contains over eight million placenames that are available for download free of charge."; it's licensed under a Creative Commons Attribution 3.0 License.
>
> According to
>
> 	http://www.geonames.org/export/web-services.html
>
> one service they offer is "Timezone":
>
>> Timezone
>>
>> Webservice Type : REST
>> Url : api.geonames.org/timezone?
>> Parameters : lat,lng, radius (buffer in km for closest timezone in coastal areas), date (date for sunrise/sunset);
>> Result : the timezone at the lat/lng with gmt offset (1. January) and dst offset (1. July)
>> Example http://api.geonames.org/timezone?lat=47.01&lng=10.2&username=demo
>>
>> This service is also available in JSON format : http://api.geonames.org/timezoneJSON?lat=47.01&lng=10.2&username=demo
>>
>>
>> Element:
>> timezoneId: name of the timezone (according to olson), this information is sufficient to work with the timezone and defines DST rules, consult the documentation of your development environment.
>> time: the local current time
>> rawOffset: the amount of time in hours to add to UTC to get standard time in this time zone. Because this value is not affected by daylight saving time, it is called raw offset.
>> gmtOffset: offset to GMT at 1. January (deprecated)
>> dstOffset: offset to GMT at 1. July (deprecated)

Geonames.org only specifies offsets as of Jan 1st and July 1st, so it is 
not very usable for accurate timezone info, but it does use the Olson tz 
database names. My own product, Time Zone Master, uses the place names 
and zone names in geonames.org to determine the zone, but then uses the 
tz database to determine accurate timezone data.

Dp


More information about the tz mailing list