X3J11
Mark Horton
seismo!cbpavo.MIS.OH.ATT.COM!mark
Fri May 1 01:34:04 UTC 1987
> Ignoring the coding and grammar errors in the Rationale,
> the big problem here is that code like the Rationale's
>
> when = *localtime(now);
> when.tm_hour += 1;
> deadline = mktime(when);
>
> printf("Loop will finish: %s\n", asctime(when));
> while (difftime(time(0), deadline) > 0) whatever();
>
> is *not* "a paradigm for continuing some loop for an hour."
> The code may continue for two hours (or not at all)
> if it is executed just before a daylight saving time transition.
How? deadline is a time_t (GMT) and so is time(0).
Mark
More information about the tz
mailing list