UTC in Windows
One reason users often set the RTC in localtime is to dual-boot with Windows (which uses localtime). However, Windows is able to deal with the RTC being in UTC with a simple registry fix. It is recommended to configure Windows to use UTC, rather than Linux to use localtime. If you make Windows use UTC, also remember to disable the “Internet Time Update” Windows feature, so that Windows does not mess with the hardware clock, trying to sync it with internet time. You should instead use an agent for the NTP to modify the RTC and sync to internet time, see #Time synchronization.
regedit, add a
DWORD value with hexadecimal value
1 to the registry:
Alternatively, create a
*.reg file (on the desktop) with the following content and double-click it to import it into registry:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=dword:00000001
If the above appears to have no affect, and a 64-bit variant of Windows is being used, using a
QWORD value instead of a
DWORD value may resolve the issue.
Should Windows ask to update the clock due to DST changes, let it. It will leave the clock in UTC as expected, only correcting the displayed time.
The hardware clock and system clock time may need to be updated after setting this value.
If you are having issues with the offset of the time, try reinstallingand then setting your time zone again:
# timedatectl set-timezone America/Los_Angeles
It makes sense to disable time synchronization in Windows – otherwise it will mess up the hardware clock.
UTC in Ubuntu
Ubuntu and its derivatives have the hardware clock set to be interpreted as in “localtime” if Windows was detected on any disk during Ubuntu installation. This is apparently done deliberately to allow new Linux users to try out Ubuntu on their Windows computers without editing the registry.
To change this behaviour in Ubuntu you need to do the following. Open the file:
and change UTC flag to UTC=yes.
To check the current zone defined for the system:
To list available zones:
$ timedatectl list-timezones
To change your time zone:
# timedatectl set-timezone Zone/SubZone
# timedatectl set-timezone Canada/Eastern
This will create an
/etc/localtime symlink that points to a zoneinfo file under
/usr/share/zoneinfo/. In case you choose to create the link manually, keep in mind that it must be a symbolic link, not hard, as specified in archlinux(7).
man 1 timedatectl,
man 5 localtime, and
man 7 archlinux for more details.
/etc/timezonestill exists in your system, you can remove it safely, since it is no longer used.