# Sync Real Time Clock (RTC)

**URL:** <https://forum.legato.io/t/sync-real-time-clock-rtc/2459>\
**Category:** Uncategorized\
**Created:** [May 16, 2017, 10:48am UTC](https://forum.legato.io/t/sync-real-time-clock-rtc/2459 "2017-05-16T10:48:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![white\_fish](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@white\_fish](https://forum.legato.io/u/white_fish)\
**Post date:** [May 16, 2017, 10:48am UTC](https://forum.legato.io/t/sync-real-time-clock-rtc/2459/1 "2017-05-16T10:48:42Z")

</div>

Hello,

I am trying to synchronize the rtc.  
Currently, I have added ntp and tzdata (set timezone) to the linux distribution to synchronize time automatically when a internet connection (mobile network) is available (I have added the TIME\_SERVICES=“qcom\_time ntpd\_time” in time\_zone.conf).  
My ntp.conf looks like this:

> tinker panic 0  
> server [0.pool.ntp.org](http://0.pool.ntp.org)  
> server [1.pool.ntp.org](http://1.pool.ntp.org)  
> server [2.pool.ntp.org](http://2.pool.ntp.org)  
> server [3.pool.ntp.org](http://3.pool.ntp.org)

But is there a better way to synchronize the time with the legato framework without explicitly installing ntp?  
Thanks!

---

<div class="post-metadata">

**Author:** ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)\
**Post date:** [October 11, 2017, 8:30am UTC](https://forum.legato.io/t/sync-real-time-clock-rtc/2459/2 "2017-10-11T08:30:00Z")

</div>

Hi white\_fish,

ntpd should be available in default image, we can use “/usr/sbin/ntpd -p [pool.ntp.org](http://pool.ntp.org)” to trigger time sync after data connection available.

---

<div class="post-metadata">

**Author:** ![outbackdingo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/outbackdingo/32/293_2.png) [@outbackdingo](https://forum.legato.io/u/outbackdingo)\
**Post date:** [December 18, 2017, 12:00pm UTC](https://forum.legato.io/t/sync-real-time-clock-rtc/2459/3 "2017-12-18T12:00:31Z")

</div>

seems to me this should have a start script… or setting the rtc time via a mobile connection if one exists  
logic says if i dont have a mobile connection i should run ntp which feels like the logical way to do this
