Code: Select all
putenv("TZ=EST5EDT,M3.2.0/2,M11.1.0/2");
Now_t = time(NULL);
localtime_r(&Now_t,&Now_tm);
localtime(&Now_t);
cout << "Timezone: " << getenv("TZ") << endl;
cout << "Time: "<< put_time(localtime(&Now_t), "%c %Z") << endl;
cout << "Timezone: " << getenv("TZ") << endl;
Code: Select all
Timezone: EST5EDT,M3.2.0/2,M11.1.0/2
Time: Sat Jun 18 12:16:07 2022 GMT
Timezone: EST5EDT,M3.2.0/2,M11.1.0/2
The revision notes show a change in time_t to a 64-bit value, but nothing about Timezones.
Did I miss something or is this a bug?
Ed