Fix previous revision:
o day and mday are the same. No need to subtract 1 from mday. o Set dow to -1 as clock_ct_to_ts() checks this field and returns EINVAL on any day of the week but Sunday.
This commit is contained in:
parent
afa0868885
commit
82d986f8fd
@ -138,10 +138,10 @@ inittodr(time_t base)
|
||||
ct.sec = tm.tm_sec;
|
||||
ct.min = tm.tm_min;
|
||||
ct.hour = tm.tm_hour;
|
||||
ct.day = tm.tm_mday -1;
|
||||
ct.day = tm.tm_mday;
|
||||
ct.mon = tm.tm_mon;
|
||||
ct.year = tm.tm_year;
|
||||
|
||||
ct.dow = -1;
|
||||
clock_ct_to_ts(&ct, &ts);
|
||||
ts.tv_sec += utc_offset();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user