Be sure to direct replies to Guido, who's not on the time zone mailing list. --ado -----Original Message----- From: Guido Flohr [SMTP:gufl0000@stud.uni-sb.de] Sent: Wednesday, May 12, 1999 8:43 PM To: tz@elsie.nci.nih.gov Subject: mktime bug? Hi, sorry, it's me again. I have problems with this little piece of code: bash$ cat >mktimetest <<EOF #include <stdio.h> #include <time.h> int main () { struct tm tm; time_t secs; memset (&tm, 0, sizeof tm); tm.year = 99; tm.mon = 4; tm.mday = 13; secs = mktime (&tm); printf ("secs: %ld (%s)\n", secs, strerror (errno)); return 0; } EOF # make mktimetest # TZ=CET-1CEST-2 ./mktimetest secs: -1 (OK) On installations where summertime applies during May mktime returns an error here (happens somewhere in the function time2). If I set tm.tm_isdst = -1; before calling mktime() the function returns the correct time. I have fixed that by inserting the line tmp->tm_isdst = -1; in mktime() before time1() gets called but I'm not sure if this is the right place to do that (or if this is correct at all). Can you verify that behavior or have I messed up my sources? If it is a bug, how should it be fixed? Thanks Guido -- http://stud.uni-sb.de/~gufl0000 mailto:gufl0000@stud.uni-sb.de
participants (1)
-
Olson, Arthur David (NCI)