david singleton | 4 Jun 2012 22:39

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

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

  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

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?

thank you
(Continue reading)

Zefram | 5 Jun 2012 11:16

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

david singleton wrote:
> export  TZ="NZST-12.00:00NZDT-13:00:00,M10.1.0,M3.3.0"
                     ^
          this dot should be a colon

>I was hoping you could help me understand what is going on?

I think that typo is all.  glibc is treating your setting as TZ="NZST-12",
silently dropping everything from the dot onwards.  It doesn't have much
room to signal the error, unfortunately.

-zefram

Paul Eggert | 5 Jun 2012 11:17
Favicon

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

On 06/04/2012 01:39 PM, david singleton wrote:
> export  TZ="NZST-12.00:00NZDT-13:00:00,M10.1.0,M3.3.0"

That first "." should be a ":", which probably explains your problem.

Ian Abbott | 5 Jun 2012 11:03
Picon
Favicon
Gravatar

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

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

(Continue reading)

Andreas Schwab | 5 Jun 2012 11:33

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

david singleton <dsingleton <at> mvista.com> writes:

> 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"
                      ^

This doesn't match the POSIX format, so you get unspecified behaviour.
Change that to a colon.

Andreas.

--

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

David Singleton | 5 Jun 2012 17:07

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


On Jun 5, 2012, at 2:33 AM, Andreas Schwab wrote:

> david singleton <dsingleton <at> mvista.com> writes:
> 
>> 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"
>                      ^
> 
> This doesn't match the POSIX format, so you get unspecified behaviour.
> Change that to a colon.

you are right.   The man page for timezone has the dot instead of colon typo.

thanks for your help

David

> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab <at> linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

Ian Abbott | 6 Jun 2012 11:19
Picon
Favicon
Gravatar

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

On 2012-06-05 16:07, David Singleton wrote:
>
> On Jun 5, 2012, at 2:33 AM, Andreas Schwab wrote:
>
>> david singleton<dsingleton <at> mvista.com>  writes:
>>
>>> 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"
>>                       ^
>>
>> This doesn't match the POSIX format, so you get unspecified behaviour.
>> Change that to a colon.
>
> you are right.   The man page for timezone has the dot instead of colon typo.

For the record, that was fixed in release 3.33 of the Linux man-pages.

--

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


Gmane