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@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 Dave
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@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@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
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
david singleton <dsingleton@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@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
On Jun 5, 2012, at 2:33 AM, Andreas Schwab wrote:
david singleton <dsingleton@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@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
On 2012-06-05 16:07, David Singleton wrote:
On Jun 5, 2012, at 2:33 AM, Andreas Schwab wrote:
david singleton<dsingleton@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 @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
participants (5)
-
Andreas Schwab -
david singleton -
Ian Abbott -
Paul Eggert -
Zefram