I typed
To update the system clock use the date command but also pass the date you want the clock set to (you need to be root/sudo to do this):
That sorted the system clock out, so I turned my attention to the hardware clock. This can be easily synchronised with the now correct system clock with the
Note: for a more detailed explanation of clocks, locales and timezones please read LinuxSA's "Linux Tips - Linux, Clocks, and Time"
Technorati Tags: Ubuntu, Linux, Date, System, Hardware, Clock, hwclock, Andrew Beacock
date
on my Ubuntu server tonight at 23:06, this is what it reported from the system clock:Tue May 29 22:56:41 BST 2007I decided to also check the hardware clock (the one maintained by the CMOS/BIOS) by running
hwclock
:Tue 29 May 2007 23:04:46 BST -0.258052 secondsLooks like I need to bring my server 'up to date'!
To update the system clock use the date command but also pass the date you want the clock set to (you need to be root/sudo to do this):
date 05292310This reads as: "set the system date to the 5th month, the 29th day, the 11th hour (pm) and ten minutes". Remember the date format is American so month first then the day!
That sorted the system clock out, so I turned my attention to the hardware clock. This can be easily synchronised with the now correct system clock with the
systohc
option:hwclock --systohcBelow is the hardware clock's date before and after the update compared to the system clock:
$ dateNow both clocks are back in sync with the real time and each other. Of course this can also be solved with ntp but that's an article for some time in the future! :)
Tue May 29 23:14:12 BST 2007
$ hwclock
Tue 29 May 2007 23:13:02 BST -0.504456 seconds
$ sudo hwclock --systohc
$ hwclock
Tue 29 May 2007 23:14:27 BST -0.679613 seconds
Note: for a more detailed explanation of clocks, locales and timezones please read LinuxSA's "Linux Tips - Linux, Clocks, and Time"
Technorati Tags: Ubuntu, Linux, Date, System, Hardware, Clock, hwclock, Andrew Beacock
Comments
You can also change time by changing timezone.
using command below.
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
sj at himalayansouvenirs.com