C
cyril
I saw that is a recurrent message but i couln't succed in founding the
solution ...
I'm developping under Linux
Does anyone have a code snippet that permit to get in a simple long
var the number of sec since 01/01/1970.... I come from the Java world
;o)
Thanks for all.
PS : the code I try give me a negative value :
tm is a tm struct
currenttime and t_70 are some time_t struct;
tm.tm_day = 1;
tm.tm_year = 1970;
t_70 = mktime(&tm); //normally initialized to 0
currenttime = time(NULL);
sec = difftime(t_70, currenttime);
solution ...
I'm developping under Linux
Does anyone have a code snippet that permit to get in a simple long
var the number of sec since 01/01/1970.... I come from the Java world
;o)
Thanks for all.
PS : the code I try give me a negative value :
tm is a tm struct
currenttime and t_70 are some time_t struct;
tm.tm_day = 1;
tm.tm_year = 1970;
t_70 = mktime(&tm); //normally initialized to 0
currenttime = time(NULL);
sec = difftime(t_70, currenttime);