1

My question is about Daylight Savings Time (DST), and whether or not the following is behaviour is normal under Linux. I am using the POSIX TZ variable to specify the timezone.

Using the example from this man page, I set the TZ variable as follows:

export TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0"

After setting this environment variable, I can use date to set the time, and then watch the clock tick over into DST. And that works out just fine (the name changes from NZST to NZDT, and we "lose" an hour of sleep).

Sun Oct  4 01:59:57 NZST 2015
Sun Oct  4 01:59:58 NZST 2015
Sun Oct  4 01:59:59 NZST 2015
Sun Oct  4 01:59:59 NZST 2015
Sun Oct  4 03:00:00 NZDT 2015
Sun Oct  4 03:00:01 NZDT 2015

But when I set the date to just before the end of DST, that's when I experience odd behaviour. For example, if I set the time like so:

date --set="20 MAR 2016 0:59:50"
Sun Mar 20 00:59:50 NZDT 2016

We're still good. But if I crank the clock forward slightly to 1:00:50 (just past 1:00am) we see a problem:

date --set="20 MAR 2016 1:00:50"
Sun Mar 20 01:00:50 NZST 2016

We've jumped out of NZDT and back into NZST too early. But if I set the system back to 0:59:50 and (patiently) wait, it does not jump out of NZDT too early, and it'll roll back to NZST at the right time.

Is this normal system behaviour?

1 Answer 1

1

I don't believe that the problem is with how the transition is handled but that the time specified in the command date --set="20 MAR 2016 1:00:50" is ambiguous.

Ie, that time occurs twice; first before the transition out of DST and then again when the clock has jumped back an hour. I'm unfortunately not sure how one would specify which occurrence of that time is desired (can the timezone be included to disambiguate it?).

2
  • Hi Håkan. I totally agree with you that the time is ambiguous. But bizarrely, I found that if I replicate this situation, but using a timezone which is to the West of the Prime Meridian (eg. CST(USA) UTC -6:00), the 'early exit' from DST doesn't happen. You can try it.
    – Andy J
    Commented Apr 14, 2015 at 6:57
  • Here's an example which I found on the IBM support pages - TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00. Using this string, I don't see the symptoms described in my original post. Switch the "6" for a "-6" however, and you can see the symptom occur.
    – Andy J
    Commented Apr 14, 2015 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .