Initializer

init(name:)

Returns a time zone initialized with a given identifier.

Declaration

init?(name tzName: String)

Parameters

tzName

The identifier for the time zone. Providing nil for this parameter raises an invalid argument exception.

Return Value

A time zone object initialized with the identifier tzName.

Discussion

If tzName is a known identifier, this method calls init(name:data:) with the appropriate data object.

See Also

Creating Time Zones

init?(name: String, data: Data?)

Initializes a time zone with a given identifier and time zone data.

init?(abbreviation: String)

Returns the time zone object identified by a given abbreviation.

init(forSecondsFromGMT: Int)

Returns a time zone object offset from Greenwich Mean Time by a given number of seconds.

class var knownTimeZoneNames: [String]

Returns an array of strings listing the IDs of all the time zones known to the system.

class var abbreviationDictionary: [String : String]

Returns a dictionary holding the mappings of time zone abbreviations to time zone names.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software