From a4d62bd32937441ff5c63044d32d7d0ddac2aae3 Mon Sep 17 00:00:00 2001 From: Michael Chicoine Date: Fri, 9 Oct 2009 09:44:55 +0000 Subject: as3514 RTC driver: correct calculation, fixes FS#10625 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23037 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/rtc/rtc_as3514.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/rtc/rtc_as3514.c b/firmware/drivers/rtc/rtc_as3514.c index 159a0456a3..43368d2dd1 100644 --- a/firmware/drivers/rtc/rtc_as3514.c +++ b/firmware/drivers/rtc/rtc_as3514.c @@ -149,7 +149,7 @@ int rtc_write_datetime(const struct tm *tm) } /* Number of days in years gone by since 1-Jan-1980 */ - year_days = 365*(tm->tm_year+20) + (tm->tm_year-1)/4 + 6; + year_days = 365*(tm->tm_year-100+20) + (tm->tm_year-100-1)/4 + 6; /* Convert to seconds since 1-Jan-1980 */ seconds = tm->tm_sec -- cgit v1.2.3