[LEAPSECS] A new use for Pre-1972 UTC
Clive D.W. Feather
clive at davros.org
Tue Feb 17 16:04:45 EST 2009
M. Warner Losh said:
> I think it would be better to define this in a different way. It
> should be defined more like:
>
> ((year - 1970) * 365 + ((year - 1969) / 4) + day_of_year) * 86400 +
> hour * 3600 + min * 60 + sec
>
> Since that's what they mean. Jan 1 is day 0, Jan 5 is day 4, etc.
Since this use case doesn't care if there are gaps in the scale, I would
make it:
(((((year-1970) * 12 + month) * 31 + day) * 24 + hour) * 60 + min) * 60 + sec
or
(((((year-1970) * 16 + month) * 32 + day) * 32 + hour) * 64 + min) * 64 + sec
or some such.
--
Clive D.W. Feather | If you lie to the compiler,
clive at davros.org | it will get its revenge.
http://www.davros.org | - Henry Spencer
More information about the LEAPSECS
mailing list