This site is hosted and sponsored by hyve.com specialists in Cloud Hosting UK and VMware Hosting. If you are interested in our services please call us for chat on 0800 612 2524
How to set the Linux clock
This is a quick time setting procedure
If you are logged in as a user (which you should be), "su" to root and enter the following to set the current time:
The time will be taken as 24-hour(military) time. Then type just the date command and see if it "took". Linux should respond with a full date and time.
Now, set the CMOS hardware clock to the system software current time:
"hwclock" is a command in /sbin. It accepts commands from the terminal, as you see above, and is called from a halt script in init.d when the system is shutdown, to copy the system time into the hardware clock.
A list of zones available in your system can be found in /usr/share/zoneinfo/zone.tab . If your zone is not correct, you can append the correct zone to the time setting:
where "zzz" is the zone
How to set the Linux clock
#
This is a quick time setting procedure
If you are logged in as a user (which you should be), "su" to root and enter the following to set the current time:
| date -s "hh:mm:ss" |
The time will be taken as 24-hour(military) time. Then type just the date command and see if it "took". Linux should respond with a full date and time.
Now, set the CMOS hardware clock to the system software current time:
| hwclock --systohc |
"hwclock" is a command in /sbin. It accepts commands from the terminal, as you see above, and is called from a halt script in init.d when the system is shutdown, to copy the system time into the hardware clock.
A list of zones available in your system can be found in /usr/share/zoneinfo/zone.tab . If your zone is not correct, you can append the correct zone to the time setting:
| date -s "hh:mm:sszzz" |
where "zzz" is the zone
Add new attachment
Only authorized users are allowed to upload new attachments.
«
This page (revision-10) was last changed on 17-Dec-2010 11:22 by Hyve Support