forked from len0rd/rockbox
tm_mon starts at 0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3173 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a9b04beba4
commit
b8f5759d96
2 changed files with 4 additions and 4 deletions
|
@ -143,7 +143,7 @@ static char *create_filename(void)
|
|||
|
||||
/* Create a filename: RYYMMDDHHMMSS.mp3 */
|
||||
snprintf(fname, 32, "/R%02d%02d%02d%02d%02d%02d.mp3",
|
||||
tm->tm_year%100, tm->tm_mon, tm->tm_mday,
|
||||
tm->tm_year%100, tm->tm_mon+1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
|
||||
DEBUGF("Filename: %s\n", fname);
|
||||
|
|
|
@ -38,7 +38,7 @@ struct tm *get_time(void)
|
|||
tm.tm_min = ((rtcbuf[2] & 0x70) >> 4) * 10 + (rtcbuf[2] & 0x0f);
|
||||
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_mon = ((rtcbuf[6] & 0x10) >> 4) * 10 + (rtcbuf[6] & 0x0f) - 1;
|
||||
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 */
|
||||
|
@ -48,8 +48,8 @@ struct tm *get_time(void)
|
|||
tm.tm_min = 0;
|
||||
tm.tm_hour = 0;
|
||||
tm.tm_mday = 1;
|
||||
tm.tm_mon = 1;
|
||||
tm.tm_year = 1970;
|
||||
tm.tm_mon = 0;
|
||||
tm.tm_year = 70;
|
||||
tm.tm_wday = 1;
|
||||
tm.tm_yday = 0; /* Not implemented for now */
|
||||
tm.tm_isdst = -1; /* Not implemented for now */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue