"daylight" variable set wrong for Europe/Berlin?
U.Mutlu
for-gmane@mutluit.com
Sat Mar 19 14:35:00 GMT 2016
Hi,
according to this site: http://www.timeanddate.com/time/change/germany/berlin
the daylight saving time in Germany (TZ="Europe/Berlin") begins
on 2016-March-27 at 02:00 and ends on 2016-Oct-30 at 03:00.
My system's default timezone is set to "Europe/Berlin" (system is Debian Linux 8).
But the "daylight" global variable has the value 1 today.
Is that not a bug? Shouldn't that variable be 1 only in the
above said daylight saving period?
Also, when I in a C/C++ program set the TZ environment variable
explicitly to "Europe/Berlin" I get the same result.
What's the logic behind this illogic? ;-)
$ ./a.out
t = time(0) = 1458397599
ctime(&t) = Sat Mar 19 15:26:39 2016
mktime(localtime(&t)) = 1458397599
mktime(gmtime(&t)) = 1458393999
difftime(...) = -3600.000000
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
switching to TZ=Europe/Berlin
t = time(0) = 1458397599
ctime(&t) = Sat Mar 19 15:26:39 2016
mktime(localtime(&t)) = 1458397599
mktime(gmtime(&t)) = 1458393999
difftime(...) = -3600.000000
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
More information about the Libc-help
mailing list