Hello, i need to make function where i get timestamp from date, i have function to get actual timestamp, it works and i make duplicate of this one and here i want parse ints with day, month, etc and return timestamp of this date. why i still getting -1 on output. Thanks :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
staticlong CasToTimestamp(int den, int mesiac, int rok, int hodina, int minuta, int sekunda)
{
//time_t t = time(NULL);
//struct tm * now = localtime(&t);
struct tm t1;
time_t t_of_day;
t1.tm_year = rok;
t1.tm_mon = mesiac - 1;
t1.tm_mday = den;
t1.tm_hour = hodina;
t1.tm_min = minuta;
t1.tm_sec = sekunda;
t1.tm_isdst = -1;
t_of_day = mktime(&t1);
return t_of_day;
}