RTC showing wrong values?

I am using COlibri T20 with Iris Carrier board. I am doing RTC program. I have build and deployed the program on Colibri T20. Initially it was showing the wrong values. But then I changed the system time according to the current date & time. Then I restarted the application, so it was showing correct day and date but the time was still wrong. I have not used the ext. battery.

178-time.png

@Krew,
You also changed the time zone. Did you save the registry after doing this? The time zone information is stored in the registry which will be lost after a re-boot unless you save the registry

Yes after changing the time zone, I have saved the registry. But still its showing wrong values of time. Is there any function through which we can set the time in code.? I don’t know where I am doing the mistake because I have just used the code provided in knowledge base.

@Krew: Which version of the image are you using?

@samuel.bissig I am using Windows CE7

@Krew: Sorry was not clear on that. I need to know the BSP version (1.3, 1.4, …). These are the Toradex Release versions not the WinCE Version.

Your timezone is +5:30 which is exactly the difference between the time displayed in the console output and the date/time properties. If you are just displaying the time retrieved from the RTC, that’s most likely stored as GMT time, so you have to convert it to localtime before displaying it. Its a little bit of work (some math involved), but you should put the values retrieved from the RTC into a SYSTEMTIME struct, then use GetLocalTime to convert the systemtime value to localtime.