kasavazala
Programmer
Can anyone tell me how to get the unix long time for the date 01/01/2099. when i am trying to use mktime from a c program, I am getting -1.
this is the chunk of code i am using
struct tm *tm;
time_t l;
int i;
long ptm;
l = time(&i);
tm = localtime(&i);
tm->tm_year=2099-1900;
tm->tm_mon=0;
tm->tm_mday=1;
tm->tm_hour=0;
tm->tm_sec=0;
tm->tm_min=0;
ptm = mktime(tm);
printf("%ld\n",ptm);
is giving me -1.
thanks in advance.
this is the chunk of code i am using
struct tm *tm;
time_t l;
int i;
long ptm;
l = time(&i);
tm = localtime(&i);
tm->tm_year=2099-1900;
tm->tm_mon=0;
tm->tm_mday=1;
tm->tm_hour=0;
tm->tm_sec=0;
tm->tm_min=0;
ptm = mktime(tm);
printf("%ld\n",ptm);
is giving me -1.
thanks in advance.