TimeZone
TimeZone
defines the behavior of a time zone. Time zone values represent geopolitical regions. Consequently, these values have names for these regions. Time zone values also represent a temporal offset, either plus or minus, from Greenwich Mean Time (GMT) and an abbreviation (such as PST for Pacific Standard Time).
- iOS
- 8.0+
- macOS
- 10.10+
- tvOS
- 9.0+
- watchOS
- 2.0+
struct TimeZone
TimeZone
provides two static functions to get time zone values: current
and autoupdatingCurrent
. The autoupdatingCurrent
time zone automatically tracks updates made by the user.
Note that time zone database entries such as “America/Los_Angeles” are IDs, not names. An example of a time zone name is “Pacific Daylight Time”. Although many TimeZone
functions include the word “name”, they refer to IDs.
Cocoa does not provide any API to change the time zone of the computer, or of other applications.