mktime() clarification
John Onusko
surfdog at unisoft.UUCP
Sat Aug 26 07:29:05 AEST 1989
I am trying to write the mktime() function documented in X3J11/88-159,
and I need some help in understanding it's intended output. It states
that it converts local time from a tm struct to a time_t format. What
I don't understand is what effect the tm_isdst flag and/or the TZ variable
has on the output.
1) should the output time (both time_t and the fixed up tm
struct) be adjusted for DST, if in effect at this time.
OR
2) is it implied that the user will supply the time in
the tm struct format, and all that is wanted is a direct
conversion to time_t format. And, the tm_isdst flag is
returned to the user who then can adjust accordingly.
This brings up a second problem in my quest for correct interpretation.
When passing tm_isdst flag as input to *presume* initially that DST is/isn't
in effect. Does...
1) a positive value have the same meaning as a negative value,
in that we are observing DST, and a check should be made to
see if DST is in effect. (Just like putting the alternate
timezone "PDT" in the TZ, i.e. TZ=PST8PDT.)
OR
2) a positive value means that that DST is in effect no matter
what time of year it is (like the DST algorithm has been
changed again), and a negative value means a check for DST
should be made.
Any help in resolving these issues would greatly be appreciated.
John Onusko
UniSoft Corp.
(415) 420-6400
surfdog at unisoft.unisoft.com
sun!unisoft!surfdog
More information about the Comp.std.c
mailing list