[PATCH] test-parse-date: fix timezone name used to test local time with DST

Sébastien Brissaud sebastien at brissaud.name
Sat Feb 13 01:24:11 EST 2016


On 2016-02-11 07:29, Yuya Nishihara wrote:
> On Sun, 07 Feb 2016 09:31:22 +0100, Sébastien Brissaud wrote:
>> -  $ TZ="PST+8PDT"
>> +  $ TZ="PST8PDT"
>>    $ export TZ
> 
> It seems "PST+8PDT" is valid.
> 
> http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

> Do you have any problem with "PST+8PDT" ?

I'm running Debian testing and test-parse-date.t failed with incorrect 
DST offsets:
-  Sat Jul 15 13:30:00 2006 -0700
+  Sat Jul 15 13:30:00 2006 -0800

Setting TZ to PST8PDT make the test pass.
But as you said earlier 'PST+8PDT' is a valid TZ value.

In fact it seems to be related as how TZ is managed on my system.

Testing it directly in a python shell exhibit the same problem:
Python 2.7.11 (default, Jan 11 2016, 21:04:40)
[GCC 5.3.1 20160101] on linux2
>>> os.environ['TZ'] = 'PST+8PDT'
>>> time.tzset()
>>> time.tzname
('PST', 'PST')
>>> 
>>> os.environ['TZ'] = 'PST8PDT'
>>> time.tzset()
>>> time.tzname
('PST', 'PDT')

PST8PDT works for me because it's resolved to a timezone file in 
/usr/share/zoneinfo.
I'll investigate the posix compliancy/configuration of TZ in my system.

test-parse-date.t is thus correct and my patch is irrelevant.

-- 
sbr


More information about the Mercurial-devel mailing list