Topics:
DVR
nvrec
Mplayer
Links
Misc
Commands
Humor
New user
uploaded files
|
(linux_command_line)-> changing time in linux redhat by command line (hardware clock->system clock) |
submited by Russell Wed 06 Jul 05 Edited Sat 05 May 12 |
check the system clock and hardware clock:
date;/sbin/hwclock
Wed Jul 6 09:49:19 EDT 2005
Wed 06 Jul 2005 09:49:06 AM EDT 0.152643 seconds
First line is the system clock, 2nd line is the hardware clock. If my machine goes a long time without restarting the system clock speeds up. Mine gains about 2 seconds per day so in a month it is a full minute fast. The hardware clock is pretty good, so usualy I just transfer the time from the hardware clock to the system clock:
/sbin/hwclock --hctosys
If the hardware clock is wrong, you can set the time via ( you have to be root to do this ):
/sbin/hwclock --set --date "07/06/2005 09:55:15"
Then transfer the hardware clock to the system clock as above. It's a good idea to double check the values before you do that, because it's easy to make am/pm errors I even typed the wrong year once. so it's a good idea to check the values via /sbin/hwclock before you transfer the value to the system clock. ( this can mess up cronjobs and all kinds of things if its totaly wrong )
Replys:
|
|