Maintaining an accurate system clock is critical for the health of your Linux environment. You might notice your server time is drifting, causing issues with system log timestamps, or perhaps you’ve just installed a new instance and the timezone defaults to UTC instead of your local region. In some cases, dual-booting with other operating systems can even cause the hardware clock to show the wrong hour every time you switch.
Ubuntu provides several robust tools to manage both the system time and the hardware clock without needing a graphical interface. Whether you need a quick manual adjustment or want to configure a high-precision NTP (Network Time Protocol) synchronization service, these built-in utilities ensure your machine stays perfectly in sync. This guide explains the most effective methods to change and verify your time settings across all modern Ubuntu distributions.
Table of Contents
Key Takeaways: Managing Ubuntu System Time
- timedatectl → The modern, recommended standard for managing time, timezones, and NTP synchronization settings.
- Timezone → Defining your Region/City is the best way to ensure local time displays correctly without manual offsets.
- Chrony → The default background daemon in Ubuntu (starting from version 25.10) that keeps your clock synchronized over the network.
- NTP Synchronization → Automating your clock updates is vital for security features like SSH certificate authentication.
- Hardware Clock → The BIOS/UEFI clock that persists even when the system is powered off.
Method 1: Using the timedatectl Command
The timedatectl utility is the primary tool for time management in systemd-based distributions like Ubuntu.
1. Check current status: Run this command to see your current time, timezone, and whether network synchronization is active: timedatectl status
2. Set the time manually: To change the time, you must first disable NTP synchronization. Use the sudo command for administrative rights. sudo timedatectl set-ntp false sudo timedatectl set-time "2026-03-30 16:30:00"
Expected Output: The system will update the clock immediately. You can verify the change by typing date.
Method 2: Changing the System Timezone
If your clock is off by exactly one or more hours, the problem is likely an incorrect timezone setting rather than a wrong clock.
1. List available timezones: timedatectl list-timezones
2. Update the timezone: sudo timedatectl set-timezone America/New_York
This method is preferred over manual time sets because it automatically handles Daylight Saving Time transitions for your specific region.
See also: Mastering the Linux Command Line — Your Complete Free Training Guide
Method 3: Synchronizing with Chrony (Recommended)
For production servers, manual time settings are discouraged. Ubuntu uses chrony by default to ensure the clock remains accurate to within milliseconds of Coordinated Universal Time (UTC).
1. Install or Verify Chrony: sudo apt install chrony
2. Restart the service to force a sync: sudo systemctl restart chrony.service
Chrony is highly efficient and factors in communication delays to prevent “upsetting” other system processes. If you are troubleshooting a server that is running slow, you should also check file size in Linux to ensure large log files aren’t being generated by time-sync errors.
Step-by-Step Process: Setting Up Automatic Time Sync
If your system is showing the wrong time after a reboot, follow these steps to enable permanent automatic synchronization:
- Open your terminal and identify your current settings using
timedatectl status. - Set your correct timezone using
sudo timedatectl set-timezone <Your_Region/City>. - Enable the NTP service to allow automatic network updates:
sudo timedatectl set-ntp true. - Install the sync daemon if it’s missing:
sudo apt install chrony. - Verify the fix by running
date +%rto see the current 12-hour clock time. - Confirm connectivity by ensuring your Ubuntu IP address allows outbound traffic to NTP pools.
Summary Tables
| Goal | Recommended Command | Purpose |
|---|---|---|
| Check Time Info | timedatectl status | View all clock and NTP metadata. |
| Set Timezone | timedatectl set-timezone | Adjust local time display based on region. |
| Sync with Network | timedatectl set-ntp true | Enables automatic clock corrections. |
| Quick Time Check | date | Displays current date and time string. |
| Restart Sync | systemctl restart chrony | Forces a fresh time handshake. |
| Metric / Term | Meaning | Role in Ubuntu |
|---|---|---|
| NTP | Network Time Protocol | Standard for syncing time over internet. |
| UTC | Universal Time | The global “zero” time servers use. |
| RTC | Real Time Clock | The battery-backed hardware clock. |
| Chrony | Time Sync Daemon | Modern Ubuntu backend for NTP. |
FAQs
Why does my time change back after I set it manually? This happens if NTP synchronization is active. The system will overwrite your manual change with the “correct” time from an internet server. Use sudo timedatectl set-ntp false to stop this behavior.
How do I display the time in a specific format? You can use arguments with the date command. For example, date +%r shows a 12-hour clock (e.g., 10:14:07 AM), while date +%s shows the Unix epoch (seconds since 1970).
Does an incorrect time affect server security? Yes. Critical security protocols like SSH certificates and two-factor authentication (TOTP) rely on the client and server clocks being perfectly synchronized.



