Real Time Clock
Get current time (system and hardware)⚓︎
On modern distributions, timedatectl can be used to get detailed time and date information.
# timedatectl
Local time: Fri 2023-12-15 13:22:09 UTC
Universal time: Fri 2023-12-15 13:22:09 UTC
RTC time: Fri 2023-12-15 13:21:40
Time zone: Universal (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
The Linux system time is synchronized with the internal real time clock at boot time.
If timedatectl
is missing, system and time can be read out using the date
command.
Hardware time:
Set system time⚓︎
or
On our default images we try to synchronize time from pool.ntp.org
on an ifup networking event. If we succeed with the ntpdate
command we synchronize the system time to hardware clock (main CPU internal real time clock).
See /etc/network/if-up.d/ntpdate-sync
and /etc/default/ntpdate
on target system.
Set hardware clock to system time⚓︎
Set system time to hardware clock⚓︎
Set alarm (wake on RTC)⚓︎
Device path⚓︎
The internal real time clock can be found at /dev/rtc0
.