Time Synchronization Command line in MacOS Big Sur

siddzy
New Contributor

I used the Command [sudo sntp -sS time.apple.com / sudo sntp -sS in.pool.ntp.org] in the Terminal to sync the System Clock time in macOS Catalina. It was working just fine. I now see that with the same Command, the Clock offset isn't getting corrected at all. If I manually change Date & Time, with the Command sudo sntp -sS time.apple.com, the result shows the offset, which much less details that used to be in previous iterations; but doesn't change the time. Did the sntp daemon change in MacOS Big Sur? Apple seems to have restricted the access to change the date and time through command line. Is there any other Command line I could use.

1 REPLY 1

dlondon
Contributor III

This might help:

#!/bin/bash
# set time server
# 2019-10-17 David London
# 
# 2020-12-09 David London
# Added in location for Big Sur as per https://www.jamf.com/jamf-nation/discussions/37544/location-services-being-skipped-jamf-26-big-sur-arm-based

# Set the timeserver
#/usr/sbin/systemsetup -setnetworktimeserver your.time.server.fqdn
/usr/sbin/systemsetup -setnetworktimeserver your.time.server.fqdn

# Set the timezone
# /usr/sbin/systemsetup -settimezone Australia/Perth
/usr/sbin/systemsetup -settimezone Country/City

# Enables the Mac to set its clock using the network time server(s)
/usr/sbin/systemsetup -setusingnetworktime on

exit 0

see the post by @snowfox in the referenced discussion as my script is pretty much that