From cc11e885d1ab32f11b322071260376de3788c62e Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 27 Jan 2003 14:24:40 +0000 Subject: Corrected get_time(). This should fix the bad file date bug. Also changed status.c to use get_time() instead of reading directly from RTC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3170 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/timefuncs.c | 2 +- firmware/common/timefuncs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/common') diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 6b979389d5..913f85f8e1 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c @@ -39,7 +39,7 @@ struct tm *get_time(void) tm.tm_hour = ((rtcbuf[3] & 0x30) >> 4) * 10 + (rtcbuf[3] & 0x0f); tm.tm_mday = ((rtcbuf[5] & 0x30) >> 4) * 10 + (rtcbuf[5] & 0x0f); tm.tm_mon = ((rtcbuf[6] & 0x10) >> 4) * 10 + (rtcbuf[6] & 0x0f); - tm.tm_year = ((rtcbuf[7] & 0xf0) >> 4) * 10 + (rtcbuf[7] & 0x0f) + 2000; + tm.tm_year = ((rtcbuf[7] & 0xf0) >> 4) * 10 + (rtcbuf[7] & 0x0f) + 100; tm.tm_wday = rtcbuf[4] & 0x07; tm.tm_yday = 0; /* Not implemented for now */ tm.tm_isdst = -1; /* Not implemented for now */ diff --git a/firmware/common/timefuncs.h b/firmware/common/timefuncs.h index 1110ad9a44..3845b946c5 100644 --- a/firmware/common/timefuncs.h +++ b/firmware/common/timefuncs.h @@ -31,7 +31,7 @@ struct tm int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ - int tm_year; /* year */ + int tm_year; /* year since 1900 */ int tm_wday; /* day of the week */ int tm_yday; /* day in the year */ int tm_isdst; /* daylight saving time */ -- cgit v1.2.3