Questions about mktime()

Mark Brader msb at sq.sq.com
Tue Jan 29 10:01:27 AEST 1991


Oops.  I just posted an article containing this example:
> 	struct tm s = localtime(t);
> 	s.tm_year++;		/* advance by one year */
> 	s.tm_isdst = -1;	/* negative --> "please determine DST" */
> 	t = mktime(s);

This should of course be:
	struct tm *s = localtime(&t);
	s->tm_year++;		/* advance by one year */
	s->tm_isdst = -1;	/* negative --> "please determine DST" */
	t = mktime(s);

Sorry about that.  I was forgetting, of course, that localtime() predates
the passing of types wider than int as arguments.
-- 
Mark Brader, SoftQuad Inc., Toronto, utzoo!sq!msb, msb at sq.com
	"I'm a little worried about the bug-eater," she said.  "We're embedded
	in bugs, have you noticed?"		-- Niven, "The Integral Trees"

This article is in the public domain.



More information about the Comp.std.c mailing list