# Time affected by reset?

**URL:** <https://forum.sierrawireless.com/t/time-affected-by-reset/2492>\
**Category:** Open AT\
**Created:** [September 9, 2008, 8:33am UTC](https://forum.sierrawireless.com/t/time-affected-by-reset/2492 "2008-09-09T08:33:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ersinArGe](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@ersinArGe](https://forum.sierrawireless.com/u/ersinArGe)\
**Post date:** [September 9, 2008, 8:33am UTC](https://forum.sierrawireless.com/t/time-affected-by-reset/2492/1 "2008-09-09T08:33:22Z")

</div>

i wonder if the rtc changes when modem resets bc of an exception. Bc i set the rtc and after few days it changes automaticly to an past date or future date.And the power is always on.  
Sometimes 5 seconds changes, sometimes 1 minutes. And i dont know what causes this time changes. The only suspection is modem reseting bc of an exeption. it happens occantionaly in my code. But i m not sure. Is there anyone who has an idea about this?

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [September 9, 2008, 10:05am UTC](https://forum.sierrawireless.com/t/time-affected-by-reset/2492/2 "2008-09-09T10:05:31Z")

</div>

Hiya,

How are you setting the RTC? Are you using the adl\_rtcSetTIme() call?

If you are using the adl\_rtcSetTime() call, ensure that your year field in the adl\_rtcTime\_t structure is 4 digits long (i.e. 2008, not 08). The adl\_rtcSetTime() call will accept a 2 digit date and appear to set the time - and adl\_rtcGetTime() will return the time you have just set - until the next reboot, when the time reverts to the last valid time set.

I found this by setting the time using adl\_rtcSetTime(), then checking the time using the +CCLK at command. I found that I was getting negative years returned with the +CCLK command when I was only using two digits for the Year field in the adl\_rtcSetTime() call.

BTW, +CCLK only requires two digits for the date field, not four.

This happens on a Q2686 running Oasis 2.02, Firmware R71a. Haven’t tested it on 2.10 yet.

Also, have you got a battery/supercap on the RTC-BAT input to your module? No RTC battery, no guarantee that the time will stay the same across reboots, and the time will certainly not stay set across power cycles.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![ersinArGe](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@ersinArGe](https://forum.sierrawireless.com/u/ersinArGe)\
**Post date:** [September 9, 2008, 3:00pm UTC](https://forum.sierrawireless.com/t/time-affected-by-reset/2492/3 "2008-09-09T15:00:35Z")

</div>

thanks for the reply but i dont use adl\_Setrtc command. i use adl\_cmdcreate creating the AT+CCLK= command and i use the year digit as two byte.  
i coundt get why the times differs. Anotherhing sometimes it goes to a future date upto 30 seconds from now. that shows it goes faster sometimes.  
thanks for your idea that may be helpful also
