Skip to content

Structure

TimeZone

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
Information about standard time conventions associated with a specific geopolitical region.
struct TimeZone

Overview

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).

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.

Topics

Operators

Initializers

Instance Properties

Instance Methods

Type Properties

Enumerations

  • enum NameStyle
    Enum you use to specify different name style of a time zone.

Default Implementations

Relationships

Conforms To

  • Foundation.ReferenceConvertible
  • Swift.Copyable
  • Swift.CustomDebugStringConvertible
  • Swift.CustomReflectable
  • Swift.CustomStringConvertible
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable
  • Swift.Escapable
  • Swift.Hashable
  • Swift.Sendable
  • Swift.SendableMetatype