[conspire] Good way to set my Ubuntu clock to UTC?

Rick Moen rick at linuxmafia.com
Mon Sep 19 01:05:16 PDT 2011


Quoting Dan Bikle (dan.bikle at gmail.com):

> What is a Good way to set my Ubuntu clock to UTC?
> 
> I am on Ubuntu 10.04

For starters, this page professes to explain the GNOME-ish way to do that.
http://www.liberiangeek.net/2010/08/change-time-zone-set-clock-synchronize-internet-servers-ubuntu-10-04-lucid-lynx/
However:

> It was not obvious how to do this via the menu:
> system -> admin -> time_and_date
> 
> The menu works well if I want to set my clock to a timezone which is
> affected by daylight savings time.
> 
> I am looking for shell commands and/or files I can edit to make this happen.

Glad you asked that.

'sudo dpkg-reconfigure tzdata' will put you through ncurses
(text-mode character-graphics) screens to select/implement time zone,
written as binary file /etc/localtime.  You'll find UTC / GMT listed in
the 'etc' category within that program.  I'm pretty sure that command
will also rewrite /etc/timezone, an ASCII file giving your chosen timezone.

I _think_ that's all you have to do, e.g., I think it'll implicitly
adjust your motherboard's hardware clock accordingly.  If not, i.e., if
system time goes off following reboot, make sure the time zone is still
UTC (as above), and do this to force the hardware clock onto UTC,
adjusting it to track system time:

   sudo hwclock --systohc --utc

Note:  If you run a dual-boot system with MS-Windows, you probably don't
want to force the hardware clock to follow UTC.  I vaguely recall that
Windows doesn't like that.





More information about the conspire mailing list