Log onto the XenServer command shell, and do the following:
ntpdate <your NTP server>
I haven’t figured out how often ntp auto-syncs time on XenServer’s yet, will post here if I find out.
crontab -e (or /etc/crontab for system crons)
# m h dom mon dow user command
01 0 * * * root ntpdate uk.pool.ntp.org
This will update system time once a day at midnight. Make sure to run it as root.
For some reason, one of the servers I look after was displaying the time as an hour earlier than it should have been. The hardware clock was showing the correct UTC time, the Ubuntu settings specified that the hardware clock was on UTC and not local time, and the timezone said Europe/London, as it should have done.
I tried syncing the server to a time using NTP but that made no difference.
What did work, in the end, was simply resetting the timezone to Europe/London. Not sure why!
Some useful things I used during this process:
Check that the hardware clock is displaying UTC: hwclock –check
Check that your ubuntu settings describe the hardware clock as UTC rather than localtime, check this file: /etc/default/rcS
The option should be: UTC=yes
Reset the timezone:
Update the time from the internet with NTP: