No subject

Robert Elz seismo!munnari!kre
Fri Apr 10 22:08:49 UTC 1987


    Date:        Fri, 10 Apr 87 11:52:31 cst
    From:        ihnp4!infoswx!lan000!rfw
    Message-ID:  <8704101752.AA13197 at infoswx.UUCP>

    In my experience, the "timezone" variable on USG systems is always
    positive -- that is, application code subtracts its value from
    the current time, rather than adding it.
This indicates a real bug, though your precise wording is incorrect.
The real problem is that timezone is the opposite sign than it ought
to be, and the fix is simply to negate it (always .. not just when it
would otherwise be negative), in zones east of Greenwich, "timezone"
should in fact be negative (and the application still subtracts its
value from the current time).

Its probably indicative of just how little used this variable is
incidentally, that this bug wasn't noticed before!  If there was
ever good evidence to simply kill "timezone" then I think this is it!

I would also be interested in exactly what application that you have
that uses this variable.  Does it use it correctly?  Simply subtracting
it from a time isn't correct, as that won't work in daylight saving
times.  About all I can think of is that you look at tm_isdst and if
that's set compensate by 1 hour (assuming that it is, always, one hour).

I don't think the other fixes are appropriate at the minute, but this
one will get into a patch posted to mod.sources.

Robert Elz



More information about the tz mailing list