Changing ESX Timezone
Following a request on a previous post, I have written this post about how to change the timezone of an ESX host from the command line.
* – None of the below requires an ESX host reboot.
Check the current timezone using the following command:
This will produce output something like this:
Given that I live in Manchester, England I would want to change to the setting that will automatically compensate for Daylight saving etc you need to set it to /Eurpoe/London. This setting will automatically change to the daylight saving when using NTP.
So to change simply cd the zoneinfo folder using this command:
For the London setting you will have to cd to the Europe folder below the zoneinfo folder:
Execute an ls, just to check that your desired timezone is there.
Now if you are still in the correct folder (/usr/share/zoneinfo/Europe) simply overwrite the existing timezone file with the correct one, as below:
cp /London /etc/localtime
Or if in any other folder:
cp /usr/share/zoneinfo/Europe/London /etc/localtime
When prompted to overwrite answer yes.
Now check that the file overwrite was successful using a diff:
diff /etc/localtime /usr/share/zoneinfo/Europe/London
If they are identical there will be no output.
Now resync NTP or run the date command to update the clock. For instructions on how to update the time without using NTP check out this article here.
The bulk of this document was adapted from an article at the VMware Communities.