Re: localtime()

Jorge Almeida <[email protected]> Sun, 4 Dec 2011 18:06:40 +0000
Newsgroups gmane.linux.lib.dietlibc
Message-ID <CAKpSnpLnuxc4ZE_Db6UaO36s+EPRn18Dnp8_+4+1v+Vfn3viyg@mail.gmail.com>
On Sun, Dec 4, 2011 at 4:11 PM, Felix von Leitner
<[email protected]> wrote:
> Thus spake Jorge Almeida ([email protected]):
>> 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
>> the correct behaviour?
>
> Do you have a patch?

Nope, I'm only an amateur who happens to enjoy making a few small programs for
home use that are immune to software upgrades that can go wrong, I'm not in the
same league as you guys. Anyway, I was not sure what is the officially expected
behavior, the linux man page is not that clear. Subtracting 24s (each second,
in a "wall-clock" program) is not ideal but it does the job.

>
> I was so happy when I got that code to return the right date for
> Europe/Berlin that I avoided touching it ever since.  The file format is
> horrible!
>
I noticed the "libugly" directory name.

I browsed the source and it appeared not to mention leapsecs. The source of
glibc seemed too different, too much indirection...

Thanks,

Jorge