# Force NTP Synchronization

**URL:** <https://forums.balena.io/t/force-ntp-synchronization/370141>\
**Category:** Product support\
**Created:** [March 19, 2024, 4:22am UTC](https://forums.balena.io/t/force-ntp-synchronization/370141 "2024-03-19T04:22:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lge](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@lge](https://forums.balena.io/u/lge)\
**Post date:** [March 19, 2024, 4:22am UTC](https://forums.balena.io/t/force-ntp-synchronization/370141/1 "2024-03-19T04:22:20Z")

</div>

I am using this command to get my current NTPSynchronization state

```auto
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket \
  dbus-send \
  --system \
  --print-reply \
  --reply-timeout=2000 \
  --type=method_call \
  --dest=org.freedesktop.timedate1 \
  /org/freedesktop/timedate1 \
  org.freedesktop.DBus.Properties.GetAll \
  string:"org.freedesktop.timedate1"

```

But NTPSynchronized always return false despite of the command chronyc makestep 0.1 (Host OS ssh) 5 that should trigger the synhronization. Is there a way to force synchronization on the container side so that running the command above will reliably return true.

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [March 20, 2024, 11:49am UTC](https://forums.balena.io/t/force-ntp-synchronization/370141/2 "2024-03-20T11:49:01Z")

</div>

Hi, you don’t specify balenaOS version and device type, so my answer will need to be general in nature.

First, balenaOS uses chronyd to keep time synchronized. And the dbus call queries timedatectl, so the fact that it states NTP is not synchronized might not mean that chrony is not synchronized.

There is some extra detail about how chrony sets the synchonized state in the kernel and how `timedatectl` reads it [here](https://github.com/balena-os/meta-balena/issues/1852#issuecomment-721260589).

What I would suggest is that you use `chronyc` to see whether NTP is synchronized or not as a starting point.

Also, up to date balenaOS versions will detect when the time is not synched and will agressively poll NTP servers until it is, so there is nothing the application needs to do in this regardd.

---

<div class="post-metadata">

**Author:** ![lge](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@lge](https://forums.balena.io/u/lge)\
**Post date:** [March 27, 2024, 12:06pm UTC](https://forums.balena.io/t/force-ntp-synchronization/370141/3 "2024-03-27T12:06:11Z")

</div>

> [@alexgg](#):
>
> ere is some extra detail about how chrony sets the synchonized state in the kernel and how `timedatectl` reads it [here](https://github.com/balena-os/meta-balena/issues/1852#issuecomment-721260589).

Thanks, sometimes the default ntp pools are failing to sync my time. So I just changed my ntp server pools on the config.json
