[LCP]time 1e9

Joachim Bauernberger bj at gmx.net
Fri Aug 24 22:08:09 UTC 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I was wondering how i get the calendertime from the seconds as in:

#include <time.h>
#include <stdio.h>
 
int main( int argc, char **argv) {

/* soemwhen on the 9th of sept. 2001 unixtime will reach 1e9 */
        time_t          now = 10000000000; 

        struct tm       *tt;
        char *c;
 
        tt = localtime(&now);
        c = ctime(&now);
 
        fprintf(stdout,"%d %d %d %d %d %d %d",tt->tm_sec, tt->tm_min, 
tt->tm_hour, tt->tm_mday, tt->tm_mon, tt->tm_year, tt->tm_wday);
        fprintf(stdout,"\n%s\n",c);
 
return 0;
}

This yields a date somewhen in 2014 Which isn't correct. Can somebody please 
point out to me what I am missing.

Thank's
Joachim

- -- 
Warning: Your HTML-mail goes straight to my trash!
You can get my public pgp key here:
http://foobar.gmxhome.de/joachim.txt
PGP fingerprint:
25 96 E0 25 48 D9 8E 10  3C C0 48 E7 AF 5A E2 C6  A3 15 05 E6


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBO4ZC5a9a4sajFQXmEQKTKgCgpkVa4WMqrm/zPRDxJQSHHsp9/usAoJBQ
2G/zoTHMTmFZkYRj8BImEHNU
=uBfJ
-----END PGP SIGNATURE-----



More information about the linuxCprogramming mailing list