tzset() from time.h sets tzname[0] as CET for TZ=Europe/Lisbon

94 views Asked by At

I/m using glibc 2.31, the standard time for Europe/Lisbon is WET. In a C program where I'm trying to change the timezone to Europe/Lisbon. First I'm setting the env variable TZ="Europe/Lisbon" then I call tzset() function. When I print tzname[0] extern variable it prints CET instead of WET.

Please can someone help me solve this issue?

I tried the same in python time library there I get WET when I print time.tzname[0]. Also when I change timezone with timedatectl set-timezone Europe/Lisbon, in timedatectl status I get WET.

Only in the C program where I'm using time.h I get CET in tzname[0] instead of WET.

0

There are 0 answers