4 ms·
November has 30 days, while the chip's real-time clock counts to 31 days in that month. Some additional commentary can be found on LKML [1]. [1] https://lkml.o
by rzzzt 11y ago
November has 30 days, while the chip's real-time clock counts to 31 days in that month. Some additional commentary can be found on LKML [1].
[1] https://lkml.org/lkml/2015/12/2/1202 https://lkml.org/lkml/2015/12/2/1202
- jsudhams 11y agoBut 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
- gpvos 11y agoThanks for that link. The discussion and the different attempted solutions are fascinating.