# Real Time Clock does not seem to update?

**URL:** <https://forums.digi.com/t/real-time-clock-does-not-seem-to-update/14032>\
**Category:** Rabbit Software\
**Tags:** time, rtc, webserver\
**Created:** [December 4, 2014, 3:25pm UTC](https://forums.digi.com/t/real-time-clock-does-not-seem-to-update/14032 "2014-12-04T15:25:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![killswitchSevenfold](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@killswitchSevenfold](https://forums.digi.com/u/killswitchSevenfold)\
**Post date:** [December 4, 2014, 3:25pm UTC](https://forums.digi.com/t/real-time-clock-does-not-seem-to-update/14032/1 "2014-12-04T15:25:32Z")

</div>

Working with a 6700 series interface board and initially updated the rtc from a web server. Reading it after the initial update gives me the correct time. Although, when I run some simple code again to check the time, all the same values remain.

Here is a subroutine from my code:

```auto
void getTime()
{
    
    unsigned int curHour = rtc.tm_hour;
    unsigned int curMin = rtc.tm_min;
    
    printf("Hour: %d
", curHour);
    printf("Min: %d
", curMin);
    
	 
}

```

If I had just updated rtc using server at the moment (1:17), I would get:

```auto
Hour: 01
Min: 17

```

What am I forgetting to do here?

---

<div class="post-metadata">

**Author:** ![MargaretK](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MargaretK](https://forums.digi.com/u/MargaretK)\
**Post date:** [December 4, 2014, 4:04pm UTC](https://forums.digi.com/t/real-time-clock-does-not-seem-to-update/14032/2 "2014-12-04T16:04:53Z")

</div>

you should run the following 2 samples found in Samples\RTCLOCK  
setrtckb.c

```
Example of setting the real-time clock from keyboard entry.

This program sets the Rabbit real-time clock from keyboard entry:
valid dates are from 1/1/1980 (entered as 1/1/80) to
12/31/2047 (entered as 12/31/47). Just press Enter
to leave the real-time clock unchanged.

```

and

rtc\_test.c

```
Example of using the real-time clock functions by checking year 2000 rollover.

 This program demonstrates the use of the RTC functions by:

```

1. reading (and saving) the current date/time settings
2. setting the date to 12/31/99 at 23:59:00
3. reading the RTC again two seconds later
4. setting the RTC back to the original date/time

---

<div class="post-metadata">

**Author:** ![trooper2](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@trooper2](https://forums.digi.com/u/trooper2)\
**Post date:** [December 4, 2014, 8:39pm UTC](https://forums.digi.com/t/real-time-clock-does-not-seem-to-update/14032/3 "2014-12-04T20:39:03Z")

</div>

What are you using to set the RTC?

You should use tm\_wr() to write to the RTC. To read from the RTC you should use read\_rtc(), not tm\_rd().

tm\_rd() reads from the macro SEC\_TIMER which will not be updated until the power is reset.
