Thursday, October 17, 2019

Set hardware time on VMware esxi 6.x from console

If you need to change the system time for a VMware esxi 6.x server fron CLI you must use the following command:

esxcli system time set

Usage: esxcli system time set [cmd options]
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 17th October 2019, 14:01:
esxcli system time set -d 17 -H 14 -m 01 -M 10 -y 2019

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

esxcli hardware clock set -d 17 -H 14 -m 01 -M 10 -y 2019

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

esxcli hardware clock get
esxcli system time get

No comments:

Post a Comment