Ubuntu – How to migrate to UTC hardware clock

time

I have been using local time hardware clock because of sharing the machine with a Windows system. Now I don't use Windows any actively and would like to set the hardware clock to UTC. How to reconfigure this in Ubuntu?

PS: I use XUbuntu actually, so I'd like a command-line-based desktop-agnostic solution.

Best Answer

Edit the file /etc/default/rcS with your favorite text editor, ie:

sudo nano /etc/default/rcS

enter image description here

Look for the UTC=foo (yes/no) line and change it to UTC=yes.

From the rcS(5) man page:

UTC
This is used to govern how the hardware real time clock is interpreted when it is read (e.g., at boot time, for the purpose of setting the system clock) and when it is written (e.g., at shutdown). If this option is set to no then the system clock is assumed to be set to local time. If the option is set to yes then the system clock is assumed to be set to something approximating Coordinated Universal Time (UTC). (POSIX systems keep a variant of UTC, without leap seconds.)