9 struct tm time_str
, *tm
;
14 time_str
.tm_year
= 2001 - 1900;
15 time_str
.tm_mon
= 7 - 1;
20 time_str
.tm_isdst
= -1;
22 if (mktime (&time_str
) == -1)
24 (void) puts ("-unknown-");
29 (void) strftime (daybuf
, sizeof (daybuf
), "%A", &time_str
);
31 result
= strcmp (daybuf
, "Wednesday") != 0;
34 setenv ("TZ", "EST+5", 1);
35 #define EVENING69 1 * 60 * 60 + 2 * 60 + 29
40 (void) puts ("localtime returned NULL");
46 t
= mktime (&time_str
);
49 printf ("mktime returned %ld, expected %d\n",
54 (void) puts ("Dec 31 1969 EST test passed");
56 setenv ("TZ", "CET-1", 1);
57 t
= mktime (&time_str
);
58 #define EVENING69_CET (EVENING69 - (5 - -1) * 60 * 60)
59 if (t
!= EVENING69_CET
)
61 printf ("mktime returned %ld, expected %ld\n",
62 (long) t
, (long) EVENING69_CET
);
66 (void) puts ("Dec 31 1969 CET test passed");