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

By default, Compute Engine instances are preconfigured to use network time
protocol (NTP), which helps keep system clocks in sync with each other. By
properly [configuring NTP on your virtual machine (VM)](https://docs.cloud.google.com/compute/docs/instances/time-synchronization#configure-ntp), you can
optimize your VM's time synchronization to account for leap seconds as they
occur.

If ensuring accurate time synchronization and monitoring the accuracy of your
time synchronization are important goals, then instead of using NTP, you can
[sync your VM's clock with its host server's clock](https://docs.cloud.google.com/compute/docs/instances/time-synchronization#configure-time-sync) by
using `chrony` and `ptp_kvm`. This configuration 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 the
following:

- Higher accuracy than third-party NTP servers.
- Handling for *leap seconds*, one-second adjustments made to UTC time to account for changes in the Earth's rotation. Leap seconds don't happen at routine intervals, because the Earth's rotation speed varies irregularly in response to climatic and geological events.

For steps to configure NTP for a VM, see
[Configure NTP for a VM](https://docs.cloud.google.com/compute/docs/instances/time-synchronization/configure-ntp).

## Configure accurate time

For accuracy designed to be within 1 ms with supported setups, you can configure
your VM to sync its clock with its host server's clock. For details, see
[Configure accurate time for Compute Engine VMs](https://docs.cloud.google.com/compute/docs/instances/time-synchronization/configure-time-sync).

## What's next

- Learn more about [PCI Data Security Standard compliance](https://docs.cloud.google.com/architecture/pci-dss-compliance-in-gcp).
- Review the [Google Public NTP FAQ](https://developers.google.com/time/faq).