Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strftime(3) %s broken?



In message <20090114101831.abbeac9c.tnn%NetBSD.org@localhost>
        on Wed, 14 Jan 2009 10:18:31 +0100,
        Tobias Nygren <tnn%NetBSD.org@localhost> wrote:
> On amd64-current built yesterday:
i386, too.

> > date +%s
> 2168577230054950868
It seems came from mktime(3).

Quick checking code.

----------------------------------------------------------------
#include <stdio.h>
#include <time.h>

main()
{
        time_t t;
        struct tm *tm;
        char buf[BUFSIZ];

        time(&t);
        printf("%lld\n", t);
        tm = localtime(&t);
        t = mktime(tm);
        printf("%lld\n", t);
}
----------------------------------------------------------------

% uname -r
5.99.6
% ./a.out 
1232245817
1232245817

% uname -r
5.99.7
% ./a.out 
1232245863
2168577230055273063

-- 
Takahiro Kambe <taca%back-street.net@localhost>


Home | Main Index | Thread Index | Old Index