On 21/03/2019 11:22:26+0100, Geert Uytterhoeven wrote: > On Wed, Mar 20, 2019 at 12:30 PM Alexandre Belloni > <alexandre.belloni@xxxxxxxxxxx> wrote: > > The SH RTC is a BCD RTC with some version having 4 digits for the year. > > > > The range for the RTCs with only 2 digits for the year was unfortunately > > shifted to handle 1999 to 2098. > > > > Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > > > --- a/include/linux/rtc.h > > +++ b/include/linux/rtc.h > > @@ -165,6 +165,7 @@ struct rtc_device { > > #define RTC_TIMESTAMP_BEGIN_1900 -2208989361LL /* 1900-01-01 00:00:00 */ > > mktime64(1900, 1, 1, 0, 0, 0) = -2208988800 ?? > > Is this due to leap seconds, and mktime64() is valid for 1970 and later only? > That's a bug, it seems I didn't use the correct timezone when doing the calculation. Thanks for spotting that, you can send a patch to correct it or I can do it. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com