Hack 8. Set Hardware Date and Time Using hwclock

by Ramesh

Before setting the hardware date and time, make sure the OS date and time is set appropriately as shown in the hack#7.

Set the hardware date and time based on the system date as shown below:

  1. # hwclock –systohc
  2.  
  3. # hwclock --systohc –utc

Use hwclock without any parameter, to view the current hardware date and time:

  1. # hwclock

Check the clock file to verify whether the system is set for UTC:

  1. # cat /etc/sysconfig/clock
  2.  
  3. ZONE="America/Los_Angeles"
  4. UTC=false
  5. ARC=false