mktime() failure vs 31-DEC-1969 23:59:59 GMT

Guy Harris guy at
Wed Feb 14 01:16:37 UTC 1996

> How do we distinguish between the two?

We don't, as far as I know.  ANSI C, as noted, doesn't specify that
"mktime()" sets "errno", so it appears there's no way of distinguishing
between "a valid 'struct tm' value that happens to translate to a
'time_t' value of -1" and "an error".  (It also doesn't specify whether
"tm_wday" and "tm_yday" are set if the "struct tm" can't be converted,
so it doesn't seem to allow you to stuff some impossible value there and
check whether it got set to some non-impossible value and, if it did,
assume it succeeded.)

More information about the tz mailing list