Introduction / Why This Matters
Precise system time is critical for many tasks: from proper encryption (SSL/TLS) and logging to job schedulers (cron) and distributed systems. The NTP (Network Time Protocol) automatically synchronizes time with reliable servers. In this guide, you'll configure NTP on macOS using both the graphical interface and the command line, so your Mac's time always stays accurate.
Requirements / Preparation
- macOS 10.12 (Sierra) or newer — commands and interface have been stable since this version.
- Administrator privileges — changing system time settings will require an administrator password when using
sudo. - Internet access — NTP servers must be reachable. If you are on a corporate network, ensure NTP traffic (port 123/UDP) is not blocked by a firewall.
- Backup (optional) — just in case, if you are configuring a server in critical infrastructure.
Step 1: Check Current Time Settings
Before making changes, check the current status. Open Terminal (via Spotlight or /Applications/Utilities/) and run:
# Check if automatic sync is enabled
systemsetup -getusingnetworktime
# Example output: "Network Time: On"
# Find the current NTP server
systemsetup -getnetworktimeserver
# Example output: "Time Server: time.apple.com"
If Network Time: Off, synchronization is disabled. If no server is listed or it's incorrect, you need to set one.
Step 2: Configure via System Settings (GUI Method)
This method suits most users.
- Open System Settings.
- Go to General → Date & Time (in newer macOS, it's "Date & Time" in the sidebar).
- Click the lock icon at the bottom and enter an administrator password to make changes.
- Enable the option "Set date and time automatically".
- In the "Time Server" field, you can:
- Choose from the suggested list (e.g.,
time.apple.com— Apple's server). - Enter any public NTP server, such as
pool.ntp.org(a pool of multiple servers) orntp.ntsc.ac.cn(for the Asia region).
- Choose from the suggested list (e.g.,
- Close the window. The system will start synchronization immediately.
💡 Tip: For maximum reliability, use servers close to your geographic location. List of public servers:
ru.pool.ntp.org(Russia),de.pool.ntp.org(Germany), etc.
Step 3: Configure via Terminal (Command Line)
Use the systemsetup command for automation or remote management.
- Disable automatic synchronization to avoid conflict with manual setup:
sudo systemsetup -setusingnetworktime off
Enter the administrator password. - Set the NTP server. For Apple's server:
sudo systemsetup -setnetworktimeserver time.apple.com
Or for the NTP pool:sudo systemsetup -setnetworktimeserver pool.ntp.org - Re-enable synchronization:
sudo systemsetup -setusingnetworktime on - Force a time sync (optional but useful for testing):
sudo sntp -sS time.apple.com
Thesntpcommand is a simplified NTP client built into macOS.
Step 4: Verify the Result
Ensure time is synchronized correctly.
- Check the current system time:
date
Compare it with an accurate time source (e.g.,time.isin a browser). - Check the status of the
timeddaemon (on macOS 12+):sudo launchctl list | grep timed
It should be active (pidis listed). - For detailed information about the last synchronization, use:
sudo ntpdate -q $(systemsetup -getnetworktimeserver | awk '{print $3}')
This shows the offset in seconds. Ifoffsetis close to 0, synchronization was successful.
Step 5: Troubleshooting Common Issues
Issue: "Cannot access time server" or "Synchronization failed"
- Cause: A firewall or network restrictions are blocking port 123/UDP.
- Solution: Check if the server is reachable:
If the connection fails, contact your network administrator or temporarily disable the firewall for testing.nc -z -v -u time.apple.com 123
Issue: Time is significantly off (more than 1000 seconds)
- Cause: System clocks have drifted too much, and the
timeddaemon cannot adjust them smoothly. - Solution: Use forced synchronization via
sudo sntp -sS <server>or temporarily disable NTP, set the time manually (sudo systemsetup -setusingnetworktime off→date 021520262026→ re-enable it).
Issue: Server resets after reboot
- Cause: Settings didn't persist due to a conflict with MDM (Mobile Device Management) on corporate Macs.
- Solution: If your Mac is managed via MDM (Jamf, Kandji), NTP configuration may be locked. Contact your administrator to change the policy.
Issue: systemsetup command doesn't work
- Cause: Outdated macOS version (before 10.12) or corrupted system utilities.
- Solution: Update macOS. As a last resort, configure the
timedservice directly vialaunchctl, but this is more complex and requires additional steps.
Additional Features
Using Multiple NTP Servers
macOS defaults to a single server. For redundancy, you can add servers to /etc/ntp.conf (requires manual editing and disabling systemsetup):
sudo nano /etc/ntp.conf
Add lines:
server time.apple.com iburst
server pool.ntp.org iburst
Then restart the service:
sudo launchctl unload /System/Library/LaunchDaemons/org.ntp.ntpd.plist
sudo launchctl load /System/Library/LaunchDaemons/org.ntp.ntpd.plist
⚠️ Important: When using
systemsetup, the/etc/ntp.conffile is ignored. Choose one method.
Configuring the Time Zone
NTP synchronizes UTC time, but a correct time zone is needed for proper display. Set it via:
sudo systemsetup -settimezone Europe/Moscow
List of time zones: sudo systemsetup -listtimezones.
Final Recommendations
- Regularly check synchronization, especially after long downtime or moving between time zones.
- For servers and critical infrastructure, use local NTP servers (e.g., based on
chronyorntpdon the local network) instead of public ones. - In corporate environments, coordinate settings with the IT department to avoid conflicts with group policies.