3 ms·
But in this link isn't code setting day to Nov 1 when it hits Oct 31? Am i reading some wrong? if (tm->tm_mon == 10 && tm->tm_mday == 31) { dev_warn(dev, "cor
by jsudhams 11y ago
But in this link isn't code setting day to Nov 1 when it hits Oct 31? Am i reading some wrong?
if (tm->tm_mon == 10 && tm->tm_mday == 31) {
dev_warn(dev, "correcting Nov 31st to Dec 1st (HW bug)\n");
tm->tm_mon = 11;
tm->tm_mday = 1;
rk808_rtc_set_time(dev, tm);
}
- rahimnathwani 11y agoMaybe they start counting months at zero.
- Someone 11y agohttp://www.cplusplus.com/reference/ctime/tm/ http://www.cplusplus.com/reference/ctime/tm/: Member Type Meaning Range tm_sec int seconds after the minute 0-61* tm_min int minutes after the hour 0-59 tm_hour int hours since midnight 0-23 tm_mday int day of the month 1-31 tm_mon int months since January 0-11 tm_year int years since 1900 tm_wday int days since Sunday 0-6 tm_yday int days since January 1 0-365 tm_isdst int Daylight Saving Time flag