Seconds from 19xx to Date (and visa versa)
Norman Diamond
diamond at csl.sony.JUNET
Thu Oct 6 11:47:15 AEST 1988
In article <5522 at hoptoad.uucp>, pozar at hoptoad.uucp (Tim Pozar) writes:
> Does anyone have a routine to change back and forth between
> seconds from 19xx to a Year, Month, Day sort of Date?
You need more than a routine to do this. You need a database of when
leap seconds have occurred. Sometimes on June 30th or December 31st,
the last minute runs from 11:59:00 to 11:59:60 (sixty-one seconds) in
order to compensate for wobbles in the earth's rotation. These do
not happen as regularly as leap days, so their occurrences cannot be
computed by a a routine; you need a database.
(The dpANSI C standard had the field for seconds redefined to allow a
value of 60 for exactly this reason. I proposed the same correction
to the committees standardizing Extended Pascal.)
--
-------------------------------------------------------------------------------
The above opinions are my own. | Norman Diamond
If they're also your opinions, | Sony Computer Science Laboratory, Inc.
you're infringing my copyright. | diamond%csl.sony.jp at relay.cs.net
More information about the Comp.lang.c
mailing list