Viewing and changing the time zone in Mac OS X via the command line uses the systemsetup
command:
$ sudo systemsetup -gettimezone
Time Zone: US/Eastern
$ sudo systemsetup -listtimezones
<snipped>
$ sudo systemsetup -settimezone US/Central
Set TimeZone: US/Central
$ sudo systemsetup -gettimezone
Time Zone: US/Central
This command is available both in 10.4 (Tiger) and 10.5 (Leopard). The key is knowing where to find it. In Leopard, it lives in a standard Unix area: /usr/sbin/systemsetup
. Unfortunately, Apple bundled systemsetup
with the Remote Desktop utility in Tiger. Therefore, if you are looking for systemsetup
in Tiger, you'll find it in /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/
.
For the curious, systemsetup
was a standard part of Mac OS X Server 10.4. Apparently it wasn't meant to be used in the desktop version, but that was changed with Mac OS X 10.5.