How to Set Up Automatic Date and Time in Ubuntu

An accurate system clock is critical for the stability of any Linux operating system. In addition to ensuring scheduled calendar reminders and alarms trigger on time, correct timestamps are mandatory for SSL certificate verification during web browsing, package authentication via apt, and database synchronization across networks. If your Ubuntu desktop displays an incorrect time after dual-booting with Windows or travelling across time zones, enabling automatic time synchronization restores absolute accuracy.

Why Do System Clocks Drift in Ubuntu?

System time discrepancies commonly stem from underlying hardware interactions:

  • Dual-Boot Windows Conflicts: Windows typically writes local time to the motherboard Real-Time Clock (RTC), whereas Linux writes Coordinated Universal Time (UTC). Booting between the two offsets the display by several hours.
  • Motherboard CMOS Battery Degradation: If a desktop or laptop is powered down without a mains connection, an aging battery can cause the internal hardware clock to lag.
  • Network Time Protocol (NTP) Inactivity: If automatic time sync is disabled, drift accumulates naturally over weeks of continuous operation.

Method 1: Enable Automatic Date and Time in Settings (GUI)

Configuring automated network clock synchronization in Ubuntu’s GNOME desktop requires only a few toggles:

  1. Click on the System Menu in the top-right corner of your desktop (the status area with battery and network icons) and select Settings.
  2. In the left-hand navigation pane, scroll down and click on System (or Date & Time directly on older releases).
  3. Click on Date & Time.
  4. Locate the option labelled Automatic Date & Time and ensure the toggle switch is flipped to the On position.
  5. Directly beneath, locate Automatic Time Zone and toggle it to On to allow Ubuntu to detect your geographical location via network geolocation.

Ubuntu will immediately query public NTP time servers and adjust your top bar clock to the exact second.

Method 2: Enable NTP Synchronization via Terminal (CLI)

If you are managing a server, working in a remote SSH terminal, or prefer shell configuration:

  1. Open your terminal application by pressing Ctrl + Alt + T.
  2. Check your current clock and synchronization status by executing:
timedatectl status

To enable network time synchronization using Ubuntu’s native systemd-timesyncd daemon, execute:

sudo timedatectl set-ntp true

Run timedatectl status once more to confirm that NTP service: active and System clock synchronized: yes are displayed.

Tip: If dual-booting with Windows continues altering your time upon reboot, force Ubuntu to interpret the hardware clock in local time by running timedatectl set-local-rtc 1 --adjust-system-clock.

Automating your system time ensures that system logs, authentication tokens, and daily tasks remain flawlessly coordinated across your Ubuntu workstation.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.