9

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.

11

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.)

1
  • Please note that in recent Ubuntu versions (since at least 16.04) the UTC setting is no longer there in /etc/default/rcS. Use /etc/adjtime instead (replace LOCAL with UTC there) or better use hwclock tool to change the file. May 29 '17 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.