I creating date() function on C++ http://aliarth.lt/date.cpp and I got one problem with localtome_to_time()
conversion. Does anyone know how that local_time variable:
int time_integer = 12345;
time_t time = (time_t)time_integer;
tm *local_time = localtime(&time);
local_time->tm_year = 100;
local_time->tm_mon = 10;
local_time->tm_mday = 1;
Convert to time_t
?
Try mktime
, here is its signature:
time_t mktime (struct tm * timeptr);
Returns the value of type
time_t
that represents the local time described by thetm
structure pointed bytimeptr
(which may be modified).