From what I've read the hwclock -r
command only returns the time in local time no matter how it is set. I think hwclock --utc
or hwclock --localtime
will change the clock to UTC or localtime. But I don't want to change it; I want to know how it is currently set.
So how can I check if my hardware clock is set to UTC time or local time?
Best Answer
Ubuntu 15.04 and later uses
systemd
as the default init system and includes thetimedatectl
program. Runningtimedatectl
will output:RTC time
is the hardware clock. Compare it to the Local time and Universal times returned bytimedatectl
to determine how the hardware clock is set.RTC in local TZ: no
means the hardware clock is interpreted as UTCRTC in local TZ: yes
means the hardware clock is interpreted as local timeTo switch using
timedatectl
sudo timedatectl set-local-rtc 0
sets RTC to UTCsudo timedatectl set-local-rtc 1
sets RTC to local timeSwitch using config file
Setting the
UTC=
setting in/etc/default/rcS
will change how the system interprets the hardware clock (UTC=yes
orUTC=no
).