Whew just got it to work without having to set the hardware clock to local time.
Code:
date --set='date and time in UTC' --utc
Code:
hwclock --systohc --utc
Now when I reboot the clock is correct. Both of those commands have to be run as root (sudo). I should add that prior to that I had done
Code:
dpkg-reconfigure tzdata
(as root) which probably played a part in the solution by setting the timezone I'm in. Also I believe that it had gotten screwed up because I had briefly booted into windows to change some power settings that I don't seem to have access to from ubuntu. It's possible that the --utc option to date is superfluous. I'm not sure about that. But I believe that the --utc option to hwclock is necessary if you want the hardware clock to be set to utc time instead of local time. By the way in case it's not obvious where it says 'date and time in UTC' I mean set it to your current date and time.
Bookmarks