Fix daylight saving time problems. Ticket #181

This commit is contained in:
Andreas Öman 2010-03-25 18:54:29 +00:00
parent 0545ca3b81
commit 48979df2f3

View file

@ -767,16 +767,17 @@ extjs_dvr(http_connection_t *hc, const char *remain, void *opaque)
t.tm_year = atoi(datestr + 6) - 1900;
t.tm_mon = atoi(datestr) - 1;
t.tm_mday = atoi(datestr + 3);
t.tm_isdst = -1;
t.tm_hour = atoi(startstr);
t.tm_min = atoi(startstr + 3);
time_t start = timelocal(&t);
time_t start = mktime(&t);
t.tm_hour = atoi(stopstr);
t.tm_min = atoi(stopstr + 3);
time_t stop = timelocal(&t);
time_t stop = mktime(&t);
if(stop < start)
stop += 86400;