Manually setting the system date (and hardware clock) in Ubuntu Linux

I typed 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 2007
I 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 seconds
Looks 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 05292310
This 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 --systohc
Below is the hardware clock's date before and after the update compared to the system clock:
$ date
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
Now 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! :)

Note: for a more detailed explanation of clocks, locales and timezones please read LinuxSA's "Linux Tips - Linux, Clocks, and Time"

Technorati Tags: , , , , , , ,

My Scan UK Search Plugin for Firefox 2 & IE 7

When I was researching PC components back in September I spent a lot of time on Scan's excellent website looking up prices, specs, etc. A few weeks ago I stumbled upon a page describing how to create OpenSearch plugins for Firefox (which can also work in IE7).

It didn't look that hard so I picked Scan's website as my target. Here is the result:

This has been tested on Firefox2 and IE7 on WinXP and Firefox2 on Ubuntu. I would be very interested to know if it works on any other browsers or platforms...

More search engines can also be found at on the Firefox Search Engines page and at

Technorati Tags: , , , , , ,