PrintLogo

Setting System and Hardware Time On GNU/Linux




It is daylight savings time again. For those systems that don't automatically sync their time, you may have to set this manually. If you are in the U.S, you can find the correct time here. Let's set the system time:

root@srv-1 u-1 # date
Mon Apr  5 03:45:59 PDT 2004
root@srv-1 u-1 # date 040504142004
Mon Apr  5 04:14:00 PDT 2004

That isn't all, though, because we have to set the hardware time:

root@srv-1 u-1 # hwclock --show
Mon Apr  5 03:52:01 2004  -0.308606 seconds
root@srv-1 u-1 # 
root@srv-1 u-1 # hwclock --systohc
root@srv-1 u-1 # hwclock --show
Mon Apr  5 04:14:30 2004  -0.602298 seconds
root@srv-1 u-1 # date             
Mon Apr  5 04:14:35 PDT 2004
root@srv-1 u-1 # 

All is good.



This article comes from NetAdminTools:
http://www.netadmintools.com/

The URL for this story is:
http://www.netadmintools.com/art348.html

Copyright 1997-2008 NetAdminTools.com. Read our Terms of Use.