Are these valid timezone definitions?
I posted a question earlier about a problem with exporting TZ, which was caused by a typo in the timezone man page on my ubuntu 10.10 system. When the typo was fixed the daylight savings end worked correctly. I've been given a new test in which one case seem to show a problem of when daylight savings starts, and one case when daylight savings ends. When a timezone is defined as : export TZ="NZST-23:00:00NZDT-24:00:00,M10.1.0,M3.3.0" the time is set one hour ahead when daylight savings begins. When I define a timezone with export TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0" there is no change in time when daylight savings ends. Is this a known problem? Or a problem with how the timezones are defined? I'll attach the test case. thanks Dave
david singleton <dsingleton@mvista.com> writes:
When I define a timezone with export TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0" there is no change in time when daylight savings ends.
Works fine here: $ TZ=NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0 date -d @1317477599 So 2. Okt 01:59:59 NZST 2011 $ TZ=NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0 date -d @1317477600 So 2. Okt 03:00:00 NZDT 2011 $ TZ=NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0 date -d @1331989199 So 18. Mär 01:59:59 NZDT 2012 $ TZ=NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0 date -d @1331989200 So 18. Mär 01:00:00 NZST 2012 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."
david singleton wrote:
Is this a known problem? Or a problem with how the timezones are defined?
I think you're confusing yourself by the way you're setting the time. It's always difficult to test timezone offset issues when you're stating the test times in local time. By the way, your testing method of modifying the system clock is problematic. It's much better to use the -d option of GNU date to display a particular time without touching the clock. Looking at DST ending with the zone you describe, I get: $ export TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0" $ date -d '2012-03-17 12:55 Z' +'%F %T %z %Z %s' 2012-03-18 01:55:00 +1300 NZDT 1331988900 $ date -d '2012-03-17 13:05 Z' +'%F %T %z %Z %s' 2012-03-18 01:05:00 +1200 NZST 1331989500 This looks perfectly correct to me. I've specified (in UT, that's the "Z") times that are ten minutes apart. The final number in the output (%s) is (except for leap seconds) a linear count of seconds, and you can see it's increased by 600, confirming that these times really are exactly ten minutes apart. The times span the end of DST, and they show that the NZ local clock (%T) jumped back an hour. The jump is explained by the UT offset (%z) having reduced by an hour, and you can see the abbreviation (%Z) has also changed accordingly. -zefram
participants (3)
-
Andreas Schwab -
david singleton -
Zefram