How to Use the macOS systemsetup Command to Change Date and Time Settings

The Power of systemsetup

In macOS, most users manage their basic computer preferences using the graphical System Settings app. However, if you are a system administrator deploying a fleet of MacBooks via a mobile device management (MDM) script, or if you are managing a headless Mac mini server over an SSH connection, you cannot click through graphical menus.

The systemsetup command is a powerful, built-in Terminal utility designed specifically for configuring core machine-level preferences. It allows you to change the time zone, enable network time synchronization, configure remote login features, and manage power settings entirely from the command line.

Step 1: Open the Terminal as Root

Because the systemsetup command alters foundational hardware and OS behaviors, it requires maximum administrative privileges. Standard users cannot run it.

  1. Press Command + Space to open Spotlight Search, type Terminal, and press Enter.
  2. Whenever you run a systemsetup command, you must prefix it with sudo.

Step 2: Managing the Time Zone

If a Mac was deployed with the wrong geographical location, its system clock will be incorrect, which can cause SSL certificate errors and login failures. You can query and change the time zone instantly.

First, list all the valid time zones recognized by macOS by running:
systemsetup -listtimezones

This will output a massive list of regions (e.g., America/New_York, Europe/London). Find your correct region.

Next, apply the correct time zone by running:
sudo systemsetup -settimezone "America/Los_Angeles"

The Terminal will output settimezone: America/Los_Angeles to confirm the change was successful.

Step 3: Enabling Network Time (NTP)

Even if the time zone is correct, the Mac’s internal clock might drift by a few minutes over several months. To ensure the clock is always perfectly synchronized with an Apple time server, you must enable Network Time.

To check if Network Time is currently active:
systemsetup -getusingnetworktime

If it returns “Network Time: Off”, you can force it on by running:
sudo systemsetup -setusingnetworktime on

Step 4: Configuring Remote Login (SSH)

If you are setting up a Mac mini to act as a headless server in a closet, you must enable Remote Login before you unplug its monitor and keyboard, otherwise, you will not be able to access it over the network.

To silently enable the SSH daemon in the background without opening the Sharing preference pane, run:

sudo systemsetup -setremotelogin on

Step 5: Managing Power and Sleep Settings

While the pmset command is generally preferred for granular power management, systemsetup provides quick access to the most critical “wake” settings, especially for desktop Macs.

If you experience a power outage, you usually want a server or a desktop Mac to boot back up automatically the moment electricity is restored. You can enable this feature via the Terminal:

sudo systemsetup -setrestartpowerfailure on

Similarly, if you want to ensure the Mac never falls asleep while processing a massive video render in the background, you can disable computer sleep entirely:

sudo systemsetup -setcomputersleep Never

Get the best tech tips delivered straight to your inbox.

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