#include "tztimeext.h" #include #include #include struct tm then = { 0, /* int tm_sec; */ 0, /* int tm_min; */ 0, /* int tm_hour; */ 1, /* int tm_mday; */ 8, /* int tm_mon; */ 81, /* int tm_year; */ }; int main() { time_t now, then_t; struct tm* a_tm; putenv("TZ=Europe/Riga"); now = time(NULL); a_tm = localtime(&now); printf("now = %ld -- %s", (long) now, asctime(a_tm)); printf("tzname = {%s, %s}\n", tzname[0], tzname[1]); then_t = mktime(&then); printf("then = %ld -- %s", (long) then_t, asctime(&then)); printf("tzname = {%s, %s}\n", tzname[0], tzname[1]); exit(0); }