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

Arthur David Olson ado
Fri Feb 16 02:42:39 UTC 1996


> > Another possibility is to save away the original tm structure; if mktime
> > returns -1, bump the tm_sec value by 1, call mktime again, and see if it
> > returns zero.
> 
> This still doesn't tell me whether the -1 return from mktime() meant
> that the time was not representable.  It does tell me whether it is
> representable one second later.  If a particular implementation of
> mktime() doesn't support times before the Epoch (and that seems okay
> as far as the standards go), then a return of 0 resulting from bumping
> the tm_sec up by 1 would lead me to the wrong conclusion concerning my
> original call.

Oops...point well taken!

Would subtracting one from tm_sec (and looking for a return of -2) work?

					--ado



More information about the tz mailing list