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?