[Zope] strftime and timezone

Hong Yuan hongyuan at homemaster.cn
Fri Mar 18 01:01:52 EST 2005


Phillip Hutchings wrote:

>That doesn't sound right, I'm 99% sure that GMT+8 is 8 hours ahead of
>GMT, to the east of the meridian, whereas GMT-8 is 8 hours behind, to
>the west. Here in New Zealand we are on GMT+13, and we're certainly
>east.
>
>Chances are that the doc refers to some Solaris quirk. Blame Sun.
>  
>
Seems this is the defined behavior of Posix, not Sun. Quoting from 
http://www.twinsun.com/tz/tz-link.htm:

Numeric time zone abbreviations typically count hours east of UTC, e.g., 
|+09| for Japan and |-10| for Hawaii. However, the POSIX |TZ| 
environment variable uses the opposite convention. For example, one 
might use |TZ="JST-9"| and |TZ="HST10"| for Japan and Hawaii, 
respectively. If the |tz| database is available, it is usually better to 
use settings like |TZ="Asia/Tokyo"| and |TZ="Pacific/Honolulu"| instead, 
as this should avoid confusion, handle old timestamps better, and 
insulate you better from any future changes to the rules. One should 
never set POSIX |TZ| to a value like |"GMT-9"|, though, since this would 
falsely claim that local time is nine hours ahead of UTC and the time 
zone is called "GMT".

And please take a look at http://twiki.org/cgi-bin/xtra/tzdate, which says:

*Greenwich Mean Time: (GMT/UCT/UTC/Universal/Zulu; positive numbers 
count hours west of GMT)
*
For China, it says:

Timezone: Etc/GMT-8
Date&time: Fri, 18 Mar 2005 13:57:30 +0800 (GMT-8)

Seems there is a lot of history and chaos behind the timezone definition.

-- 
HONG Yuan
Homemaster Trading Co., Ltd.
No. 601, Bldg. 41, 288 Shuangyang Rd. (N)
Shanghai 200433, P.R.C.
Tel: +86 21 55056553
Fax: +86 21 55067325
E-mail: hongyuan at homemaster.cn



More information about the Zope mailing list