[tz] bug in export TZ where day light savings spans Dec 31st?

Ian Abbott abbotti at mev.co.uk
Tue Jun 5 09:03:57 UTC 2012


On 04/06/12 21:39, david singleton wrote:
> When I use the example from the timezone man page to define,  and export
> a local TZ variable:
>
>    export  TZ="NZST-12.00:00NZDT-13:00:00,M10.1.0,M3.3.0"
>
> And then set the date to December 31st at 23:59 I see the clock roll over to 00:00
> normally.
>
> But when I define a timezone using a positive offset I see time get
> set backwards at December 31st.   I believe time should not get set back
> on December 31st for any timezones whose day light savings span December 31st.
>
>    export  TZ="NZST+12.00:00NZDT+13:00:00,M10.1.0,M3.3.0"
>
>    date  123123592011.55
> Sat Dec 31 23:59:55  2011

I just tried this and I got

Sat Dec 31 23:59:55 NZST 2011

>    when I wait 5 seconds and check the date again I see the date has been
> adjusted to Dec 31st at 12:00?
>
>    root at dstest2:~# date
>    Sat Dec 31 12:00:01 NZST 2011

I waited about 9 seconds and got

Sun Jan  1 00:00:04 NZST 2012

> What is happening with TZs defined with a positive offset?
>
> I can reproduce this on Linux systems using glibc 2.5.90 up through glibc 2.12.1.
>
> I was hoping you could help me understand what is going on?

I couldn't reproduce your problem, but I notice your first output was 
missing the timezone abbreviation, so it was defaulting to UTC when 
setting the time. I don't know why it would do that, but I was using a 
later GNU glibc 2.15(.something) and the 'date' command from GNU 
coreutils 8.17.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the tz mailing list