Configure time synchronization

Linux Windows

Many software systems that depend on careful sequencing of events rely on astable, consistent system clock. System logs written by most services include atimestamp, which helps debug issues that occur between various components ofyour system.

By default, Compute Engine instances are preconfigured to use network timeprotocol (NTP), which helps keep system clocks in sync with each other. Byproperlyconfiguring NTP on your virtual machine (VM), you canoptimize your VM's time synchronization to account for leap seconds as theyoccur.

If ensuring accurate time synchronization and monitoring the accuracy of yourtime synchronization are important goals, then instead of using NTP, you cansync your VM's clock with its host server's clock byusingchrony andptp_kvm(Preview). Thisconfiguration is designed to achieve accuracy within 1 ms for supported setups.

Configure network time protocol (NTP) on a VM

Compute Engine instances are preconfigured to use network time protocol(NTP), which helps keep system clocks in sync with each other, and includes thefollowing:

  • Higher accuracy than third-party NTP servers.
  • Handling forleap seconds, one-second adjustments made to UTC time toaccount for changes in the Earth's rotation. Leap seconds don't happen atroutine intervals, because the Earth's rotation speed varies irregularly inresponse to climatic and geological events.

For steps to configure NTP for a VM, seeConfigure NTP for a VM.

Configure accurate time

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

For accuracy designed to be within 1 ms with supported setups, you can configureyour VM to sync its clock with its host server's clock. For details, seeConfigure accurate time for Compute Engine VMs.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.