This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10625 - Calendar off by a couple days, saving time increments date by 1
Attached to Project:
Rockbox
Opened by Eric Farmer (databat) - Tuesday, 29 September 2009, 20:06 GMT+2
Last edited by Michael Chicoine (mc2739) - Friday, 09 October 2009, 11:46 GMT+2
Opened by Eric Farmer (databat) - Tuesday, 29 September 2009, 20:06 GMT+2
Last edited by Michael Chicoine (mc2739) - Friday, 09 October 2009, 11:46 GMT+2
|
DetailsDaily Build r22850-090929 for the Sansa e200 V2
The calendar is a bit off. Today is September 29, 2009 on a Tuesday, and the Calendar shows it's on a Sunday. (two days off! And yes, I am certain it is set for the correct date and time. I checked it 8 times to make sure I wasn't seeing things.) I have also noticed, each time you go under System, Set Time and Date, each time you make a change it increments the date by one when you save. You have to set the date to one day before the current one, then upon saving it will increment to the correct time. (I discovered this while trying to figure out why the calendar was off) |
This task depends upon
Closed by Michael Chicoine (mc2739)
Friday, 09 October 2009, 11:46 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed in r23037
Friday, 09 October 2009, 11:46 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed in r23037
This is most likely the reason for the problems in the calendar plugin.
I have also seen this, around the time the RTC offset was adjusted so that Rockbox would show the same time as the OF. If I remember correctly, I changed the date in the OF and then returned to Rockbox and changed the date back to the correct setting (it might have been the opposite, change date in RB then correct in OF). After performing this process, I have no longer had problems with date adjustment.
I have not heard of any others Sansa AMS users who have seen this problem. I have tried unsuccessfully to recreate the problem for further debugging.
Not solved yet, but not tried <r22839 yet..
Edit: I have confirmed this did start with r22839
I did look through the changes that i made in that patch again and can not see any obvious mistakes, that does of course not mean there aren't any :)
In looking at the code, at line 152, tm->tm_year = 109. This is due to adding 100 at line 97. This additional 100 has not been taken into account in the calculations on line 152.
I have attached a patch to fix rtc_as3514.c and tested on both the e200 and e200v2 for proper operation. I did not simplify the math for clarity. You can change it if it makes more sense to simplify.
I scanned through the other rtc drivers and it appears that this was the only one with this problem.
Thanks for fixing it, please commit.