🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #494

mktime() clarification

#494
From: John Onusko
Date: Fri, 25 Aug 1989 21:29
39 lines
1782 bytes
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@unisoft.unisoft.com
sun!unisoft!surfdog
Technical Details
Message-ID: <2404@unisoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!unisoft!surfdog

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!unisoft!surfdog
From: surfdog@unisoft.UUCP (John Onusko)
Newsgroups: comp.std.c
Subject: mktime() clarification
Keywords: mktime(), ansi
Message-ID: <2404@unisoft.UUCP>
Date: 25 Aug 89 21:29:05 GMT
Lines: 39