To change the time zone, please follow the steps below.
Note: It is not necessary to reboot the ESX Server host after following this procedure.
- Log into the ESX Server service console as root.
- Find the desired time zone under the directory
/usr/share/zoneinfo .
Note: Some regions have multiple files in a subdirectory. For example,
US contains several files, each representing a time zone.
The example below uses
/usr/share/zoneinfo/US/Pacific as the new time zone file.
-
Use
nano ( or another text editor) to open
/etc/sysconfig/clock . At the command pompt, type: nano /etc/sysconfig/clock Edit
this file to show the relative path to the file representing the new
time zone, and ensure that UTC and ARC are set as shown:
ZONE="US/Pacific"
UTC=false
ARC=false
- Copy the desired time zone file to
/etc/localtime . Continuing the example using
US/Pacific :
cp /usr/share/zoneinfo/US/Pacific /etc/localtime
At the
cp: overwrite `/etc/localtime'? prompt, answer
y to replace the file representing the old time zone. Again, it is not necessary to reboot the ESX Server host after updating /etc/localtime .
- Confirm that /etc/localtime has been updated with the correct zoneinfo data using the following steps:
-
-
Reference the zoneinfo file used in step 2 and compare it to / etc/localtime using the diff command.
[root@esxhost]# diff /etc/localtime /usr/share/zoneinfo/US/Pacific
If the files are identical, your prompt will return without any output.
-
If /etc/localtime is not the same as the /usr/share/zoneinfo/<your location> , the output from the diff command will be something like the following:
Binary files /etc/localtime and /usr/share/zoneinfo/US/Pacific differ
If the files are not the same, repeat step 4.
After updating /etc/localtime with the correct zoneinfo data, confirm the system and hardware clocks are correct. Use the Linux date command to check and set the correct time if necessary. Set the hardware clock to match the correct system time.
- Set the system clock to the local date and time:
date MMDDhhmmYYYY
- Update the hardware clock with current time of the system clock:
/sbin/hwclock --systohc
Note: Upon booting, ESX Server runs
/etc/rc.d/init.d , which reads
/etc/sysconfig/clock to
set the system clock based on the hardware clock's current time and the
configured time zone information. To synchronize ESX Server to an
external time reference, see http://kb.vmware.com/kb/1339 .
Reference the VMware Knowledge Base at http://kb.vmware.com for additional information about timezone, including issues with Daylight Saving Time (DST).
|