Type Property

local

An object that tracks the current system time zone.

Declaration

class var local: TimeZone { get }

Discussion

Use this property when you want an object that always reflects the current system time zone. Contrast this behavior with that of the system class property, which has its value cached until you manually clear it by calling the resetSystemTimeZone() method.

Although the time zone obtained here automatically updates with the system, it provides no indication when system settings change. To receive notification of time zone changes, add an observer to the NSSystemTimeZoneDidChange notification by using the addObserver(_:selector:name:object:).

See Also

Working with System Time Zones

class var system: TimeZone

The time zone currently used by the system.

class func resetSystemTimeZone()

Clears any time zone value cached for the system property.

class var `default`: TimeZone

The default time zone for the current app.

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