Setting the hardware clock and system time

I have had persistent problems properly setting the hardware clock and system time using Mandriva's graphical tools. This documents how to do so using the terminal. …

The following presumes the hardware clock to be in UTC and the system time set to the local time zone.

First, see what time the hardware clock (first line) and the system time (second line) think it is:

hwclock --utc --show
date

In both cases the time will be shown in local time, despite being stored in the hardware clock in UTC.

If the hardware clock is incorrect, set it:

hwclock --utc --set --date="8/24/09 09:04:00"
hwclock --utc --show

The first line says that the hardware clock should be set to 9:04:00 am, August 24, 2009, local time, but to store it in UTC. The second line displays in local time the hardware clock's new value to check your work.

Now set the system time to agree with the hardware clock (first line) and check your work (second line):

hwclock --utc --hctosys
date

Your hardware clock and system time are now correct. The graphical clock in your desktop environment should update itself within a few seconds.

TODO: Document how to check and correct local time zone. tzselect might do this, or changing TZ= in a */profile file. Is this a system-wide setting, per user, or both?

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s