Re: localtime()
Thorsten Glaser <[email protected]> Sun, 4 Dec 2011 17:53:10 +0000 (UTC)
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
Felix von Leitner <felix-dietlibc <at> fefe.de> writes:
> Thus spake Jorge Almeida (jjalmeida <at> gmail.com):
> > localtime() doesn't seem to take leap seconds into account. I have a
> > right/* timezone and I expected (perhaps wrongly) localtime() to
> > return the correct UTC time. Instead, I have to subtract 24s. Is this
> Do you have a patch?
I can probably provide one, given “enough spare time” (hah!).
I’ve changed MirBSD to globally honour leap seconds, as required
by German law (in direct contradiction to POSIX, making it illegal)
mostly using algorithms from DJB. It will be nōntrivial, but I can
test against both posix/ and right/ timezones and validate the
results (got the experience…).
bye,
//mirabilos (pulling out the fitting signature)
--
“It is inappropriate to require that a time represented as
seconds since the Epoch precisely represent the number of
seconds between the referenced time and the Epoch.”
-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2