VMWare: How to Change the ESXi System Time and HW Clock using the command line.

Step-by-step guide

To reset the time on the VMWARE platform.

Log in using putty.exe to 192.168.180.115

user as per infrastructure Document

password as per infrastructure Document.

At the command line the following caoomand can be used to change the system clock.

The system clock can be set using the esxcli system time set command, but this time will revert back to the hardware clock time when the system is rebooted or reverting to a previous image.


The format of the command is as follows.


Usage: esxcli system time set [cmd options]
Description:
set Set the system clock time. Any missing parameters will default to the current time
Cmd options:
-d|--day=<long> Day
-H|--hour=<long> Hour
-m|--min=<long> Minute
-M|--month=<long> Month
-s|--sec=<long> Second
-y|--year=<long> Year

So, to set the system time to 28th July 2015, 12:07 (pm):

esxcli system time set -d 28 -H 12 -m 05 -M 07 -y 2015


Also, make sure that to set the hardware clock time as the system time will revert to this on a reboot:

~ # esxcli hardware clock set -d 28 -H 12 -m 06 -M 07 -y 2015 <- sets the hardware clock to 8th July 2015, 12:07 (pm):

To check the hardware and system time we can use the following commands:

esxcli hardware clock get
esxcli system time get