Setting the Time and Timezone Using NTP Service

Use the timedatectl command on the Host VM to perform following operations to sync the time between the host and the docker:

  • Displaying the Current Date and Time: timedatectl

  • Changing the Current Time: timedatectl set-time HH:MM:SS

  • Changing the Current Date: timedatectl set-time YYYY-MM-DD

  • Listing the Time Zone: timedatectl list - timezones

  • Changing the Time Zone: timedatectl set-timezone time_zone

  • Enabling NTP Service: timedatectl set-ntp yes