在终端修改 Mac 的时区
按时区名称直接设置系统时区,适合出差归来或批量预配置新 Mac。
执行 sudo systemsetup -settimezone "Asia/Shanghai" 立即将 Mac 切换为中国标准时间。
01命令
命令
$ sudo systemsetup -settimezone "Asia/Shanghai" && sudo systemsetup -gettimezone02作用说明
时区参数必须是有效的 IANA 时区名(区域/城市 格式),写错会被静默拒绝,可先运行 sudo systemsetup -listtimezones 找到准确名称,再用 -gettimezone 确认结果。通过 systemsetup 执行,同一行命令也可以经 SSH 批量管理多台机器。
03风险
!注意: 如果系统设置里开启了「使用当前位置自动设定时区」,macOS 下次定位成功后可能改回去。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- systemsetup - Set System Configuration Preferences依据: Documents -settimezone to set the current time zone (e.g. 'US/Pacific') and -gettimezone to display it.
- About systemsetup in Remote Desktop依据: Apple's official Remote Desktop guide lists systemsetup commands including -settimezone for setting the current time zone and -gettimezone for viewing it.
最后验证: 2026-09-19 · 分类: 系统与设置