# Using the Real Time Clock (RTC) on Zymkey

**URL:** <https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84>\
**Category:** ZYMKEY4\
**Created:** [November 22, 2016, 9:51am UTC](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84 "2016-11-22T09:51:43Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [September 28, 2017, 6:38am UTC](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84/21 "2017-09-28T06:38:23Z")

</div>

Zymkey would be able to provide a stable time reference when your host computer boots up. From that point on, you can reference the time using the standard libraries (e.g. time function call in C or date command line utility). However, the host pi clock will continue to drift independently after the boot-time reference is obtained from Zymkey. Another option would be to call the Zymkey API to get the clock in C/C++/Python.

We don’t expose an API which would allow one to set the Zymkey RTC since Zymkey is considered to be a secure device. Instead, an interface daemon determines when NTP is synchronized and enabled and sets the time from the current system time.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![caymanfr](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@caymanfr](https://community.zymbit.com/u/caymanfr)\
**Post date:** [September 28, 2017, 8:44am UTC](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84/22 "2017-09-28T08:44:04Z")

</div>

Thanks for your answer.  
So if I do not have any NTP, I cannot set the time or adjust it if needed ? My device will never be connected to any ntp server…

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [October 19, 2017, 4:41pm UTC](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84/23 "2017-10-19T16:41:32Z")

</div>

This is true. We think of the Zymkey’s RTC as more of a “time bootstrap” during power and/or network outages. And, to promote security, we don’t allow the time to be set in user space by an arbitrary application. Although I don’t know the exact circumstances in your use case, in a real deployment which would never be in contact with an NTP time source, I would recommend allowing the time to be set by NTP one time before deployment in the field.

---

<div class="post-metadata">

**Author:** ![Phil\_S\_Zymbit\_1](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@Phil\_S\_Zymbit\_1](https://community.zymbit.com/u/Phil_S_Zymbit_1)\
**Post date:** [October 25, 2017, 6:08pm UTC](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84/24 "2017-10-25T18:08:01Z")

</div>



[Previous page](https://community.zymbit.com/t/using-the-real-time-clock-rtc-on-zymkey/84.md?page=1)
