On macOS, you set the system clock from the command line with the BSD date command and a bare numeric argument:
# Set the clock to 2026-06-14, 12:00:
sudo date 0614120026That is it. The number is MMDDhhmm[[CC]YY][.ss]: two digits each of month, day, hour (24-hour), and minute, then an optional year, then optional seconds. No flags, no separators. You need sudo because the system clock is root-owned.
The reason this article exists is that the most-copied answer on the internet is wrong. You will see sudo date -I 06142024 passed around as the way to set the date on a Mac. It is not. -I is the ISO 8601 output flag, on GNU date and on the current macOS date alike, and it has nothing to do with setting anything. Run that command and the trailing number is misread as month, day, hour, and minute, so you never get the clock you wanted. Below is the correct form, field by field, plus the one step everyone forgets: turning off network time first, or macOS quietly puts the clock back where it was.
The BSD date set syntax, field by field
macOS uses the BSD userland, so date is the BSD utility, not GNU coreutils. Its full set form is a single positional number. The man page writes it as:
sudo date [[[mm]dd]HH]MM[[cc]yy][.ss]Read left to right, the eight common digits spell out MMDDhhmm:
| Field | Meaning | Digits |
|---|---|---|
MM | Month (01-12) | 2 |
DD | Day of month (01-31) | 2 |
hh | Hour, 24-hour (00-23) | 2 |
mm | Minute (00-59) | 2 |
CC | Century, optional (e.g. 20) | 2 |
YY | Year within century, optional (e.g. 26) | 2 |
.ss | Seconds, optional, after a dot | 2 |
Strictly speaking, the only mandatory field is the minutes (the man synopsis nests every field to the left of MM as optional: [[[mm]dd]HH]MM), and the century, year, and seconds on the right are optional too. In practice you almost always type the full MMDDhhmm block plus a year, because setting the minute alone (sudo date 30) just moves the clock to minute 30 of the current hour, which is rarely what you want. Any field you omit defaults to its current value. So a worked example for June 14, 2026 at 12:00:30:
sudo date 0614120026 # MMDDhhmm + YY (year shorthand: 26)
sudo date 061412002026 # MMDDhhmm + CCYY (full year: 2026)
sudo date 061412002026.30 # ...with seconds (.30)If you drop the year entirely (sudo date 06141200) the command keeps the current year and just changes the month, day, hour, and minute. To read the clock without touching it, run date with no argument and no sudo.
A common stumble: the field order is month first, then day, not day-month. 0614 is June 14, not the 6th of the 14th month. If you are coming from a DD/MM locale, that flip is the first thing to double-check.
Why date -I does not set anything
This is the wrong-source correction worth internalising. The -I form circulates because Linux examples leak onto Mac how-tos, and the two date commands are not the same program:
- GNU
date(Linux) uses-d/--dateand-s/--setto interpret and set time, and-I/--iso-8601to print the date in ISO-8601 format.-Iis an output formatter. It never sets the clock, even on Linux. - BSD
date(macOS) sets the clock with the bareMMDDhhmm[[CC]YY]string shown above. It has no--setflag. The current macOSdatedoes accept-I[FMT](its man page: "Use ISO 8601 output format", added upstream in FreeBSD 12.0), but with the same meaning as on Linux: it only changes how the date is printed.
So here is what sudo date -I 06142024 really does on a current Mac. -I switches the output to ISO 8601, and the trailing 06142024 is then parsed by the normal set syntax as MMDDhhmm: June 14, 20:24, in the current year. The clock does move, just not to 2024 and not to the time you had in mind. I checked the parsing on macOS 26 with the no-set flag: date -j -I 06142024 prints 2026-06-14, and date -j 06142024 prints Sun Jun 14 20:24:00 EDT 2026. On a macOS old enough that its date predates the flag, the same command fails on the unknown option instead. Either way, -I is not what sets anything.
If you genuinely want GNU date semantics on a Mac (the -d "next friday" style parsing, --iso-8601 output, and so on), install coreutils and use gdate:
brew install coreutils
gdate -d "2026-06-14 12:00" "+%Y-%m-%d %H:%M" # GNU date, prefixed gReach for gdate for the parsing and formatting that people actually want -I for. To actually move the macOS system clock, stick with the BSD sudo date MMDDhhmm… form above: it is the documented, dependable way on macOS, where the BSD date is what the OS ships and supports.
Turn off network time first, or macOS resyncs
Here is the step that makes manual setting look broken when you skip it. By default macOS keeps the clock synced over the network (NTP), so the moment you set the date by hand, the time service notices the drift and silently corrects it back. Your sudo date worked; the OS just undid it seconds later.
Disable automatic network time before you set the clock:
sudo systemsetup -setusingnetworktime off
sudo date 0614120026Check the current setting any time with sudo systemsetup -getusingnetworktime. While network time is off the clock holds whatever you set, which is exactly what you want for testing.
When you are done, turn it back on and macOS resyncs to the correct real time immediately:
sudo systemsetup -setusingnetworktime onThat resync is the clean reset: you do not have to figure out the right current time by hand, the time service does it for you. If you want a one-shot correction without toggling the setting, use sntp instead, which is the NTP client macOS ships (it replaced ntpdate, removed back in macOS 10.14 Mojave):
sudo sntp -sS time.apple.comOn the macOS build, -s slews the clock with adjtime(2) when the offset is small (under 50 ms) and -S steps it with clock_settime(2) when the offset is larger, so passing both lets sntp pick the right correction for the size of the drift; time.apple.com is Apple's own NTP host. This pulls the real time once and leaves the network-time setting where it was.
While you are in systemsetup, sudo systemsetup -settimezone "America/New_York" sets the timezone (list valid zones with sudo systemsetup -listtimezones), which is a separate concern from the clock value but often comes up in the same breath.
The actual use case: testing date-based logic
Almost nobody sets the Mac clock because they think it is wrong. They set it to test code that behaves differently on a certain date: a subscription that expires, a coupon that activates next week, a cron-style job, a "your trial ends in 3 days" banner, a certificate that goes stale. Moving the system clock forward is the brute-force way to see that path fire.
The brute-force way has a cost, though: every other app on the machine now thinks it is a different day, your TLS handshakes may fail, and if you forget to turn network time back on you are debugging a "wrong clock" for the rest of the afternoon. So the disciplined version is: turn network time off, set the date, run your test, turn network time back on. Keep that loop tight.
If you find yourself doing this often, a tool like libfaketime is worth a look: it intercepts time calls for a single process rather than moving the whole machine's clock, so you never touch the real system time at all. That is the cleaner long-term answer for repeatable date-based tests, while sudo date is the quick one-off.
Because -I is an ISO 8601 output option, on GNU date and on the current macOS BSD date alike: it changes how a date is printed and never sets one. In sudo date -I 06142024, macOS reads the trailing number with its own set syntax as month, day, hour, and minute (June 14, 20:24, current year), not as a date in 2024. Set the clock with the bare numeric form instead: sudo date 0614120026.
The BSD set form is MMDDhhmm with an optional year and seconds: month, day, hour (24-hour), minute, then optionally century, year, and a dot plus seconds. For 2026-06-14 12:00 that is sudo date 0614120026 (two-digit year) or sudo date 061412002026 (full year).
macOS keeps the clock synced over the network, so it corrects your manual change within seconds. Run sudo systemsetup -setusingnetworktime off before you set the date, and sudo systemsetup -setusingnetworktime on afterwards to resync to the real time.
Yes. The system clock is owned by root, so changing it requires sudo. Reading the clock does not: plain date with no arguments prints the current date and time without elevation.
Install coreutils with Homebrew (brew install coreutils) and use gdate, which is GNU date under a prefixed name. It gives you -d "next friday" parsing and --iso-8601 output. Use it for parsing and formatting; to set the macOS clock, stay on the BSD sudo date 0614120026 form, which is the documented way on macOS.
See also
- Verify a file checksum on macOS: another BSD-vs-GNU tooling gotcha, shasum and md5 instead of md5sum.
- View your calendar and events from the macOS command line: cal, ncal, and icalBuddy once the clock is sorted.
- Open apps, files, and URLs from the macOS command line: the open command, another small BSD-only Terminal tool worth knowing.
- Change the system volume from the macOS command line: the osascript one-liner for setting, muting, and reading the output level, another scriptable Mac control.
- Set the desktop wallpaper from the macOS command line: the osascript AppleScript that covers every display, with the modern caching gotcha.
Sources
Authoritative references this article was fact-checked against.
- date(1): current macOS manual page (-I[FMT] ISO 8601 output, set syntax)keith.github.io
- date(1) command reference for macOS (ss64)ss64.com
- date(1) BSD manual pageman.openbsd.org
- systemsetup(8) command reference for macOS (ss64)ss64.com
- sntp(8) command reference for macOS (ss64)ss64.com
- Setting the time, GNU coreutils date manualgnu.org

![Set the Date and Time From the macOS Command Line (BSD date) Set the macOS clock from Terminal with the BSD date command: MMDDhhmm[[CC]YY], not date -I (an ISO 8601 output flag that sets nothing). Turn off network time first or macOS resyncs.](https://images.techearl.com/mac-set-date-command-line/mac-set-date-command-line-1536.webp)



