Set VMware ESXi Date & Time Using esxcli

Yesterday, 2021-03-02, i ran into a problem where one ESXi server didn’t sync it’s time with the NTP server configured. It was lagging approximately 2h, 22min & 15sec. Current UTC was 07:51:55 when it should have been 10:13

The well known command esxcli is your friend if doing this via command line via SSH. trying “esxcli system time set” will give you:

  • You must specify one of year, month, day, hour, minute or second
  • If you need the exact options you can just give  “esxcli system time set –
    • 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

Gives you a pretty good idea how to set date and time and in the below example i provide all the options.

esxcli system time set –day=2 –month=3 –year=2021 –hour=10 –min=15 –sec=0

Now all good 🙂