<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/TimeZone",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8TimeZoneV"
  },
  "title" : "TimeZone"
}
-->

# TimeZone

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

### Getting the Current Time Zone

[`static var autoupdatingCurrent: TimeZone`](/documentation/Foundation/TimeZone/autoupdatingCurrent)

The time zone currently used by the system, automatically updating to the user’s current preference.

[`static var current: TimeZone`](/documentation/Foundation/TimeZone/current)

The time zone currently used by the system.

### Creating a Time Zone

[`init?(secondsFromGMT: Int)`](/documentation/Foundation/TimeZone/init(secondsFromGMT:))

Returns a time zone initialized with a specific number of seconds from GMT.

[`static var knownTimeZoneIdentifiers: [String]`](/documentation/Foundation/TimeZone/knownTimeZoneIdentifiers)

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

[`static var abbreviationDictionary: [String : String]`](/documentation/Foundation/TimeZone/abbreviationDictionary)

Returns the mapping of abbreviations to time zone identifiers.

### Getting Time Zone Information

[`var identifier: String`](/documentation/Foundation/TimeZone/identifier)

The geopolitical region identifier that identifies the time zone.

[`func abbreviation(for: Date) -> String?`](/documentation/Foundation/TimeZone/abbreviation(for:))

Returns the abbreviation for the time zone at a given date.

[`func secondsFromGMT(for: Date) -> Int`](/documentation/Foundation/TimeZone/secondsFromGMT(for:))

The current difference in seconds between the time zone and Greenwich Mean Time.

[`static var timeZoneDataVersion: String`](/documentation/Foundation/TimeZone/timeZoneDataVersion)

Returns the time zone data version.

### Working with Daylight Savings

[`func isDaylightSavingTime(for: Date) -> Bool`](/documentation/Foundation/TimeZone/isDaylightSavingTime(for:))

Returns a Boolean value that indicates whether the receiver uses daylight saving time at a given date.

[`func daylightSavingTimeOffset(for: Date) -> TimeInterval`](/documentation/Foundation/TimeZone/daylightSavingTimeOffset(for:))

Returns the daylight saving time offset for a given date.

[`var nextDaylightSavingTimeTransition: Date?`](/documentation/Foundation/TimeZone/nextDaylightSavingTimeTransition)

The date of the next (after the current instant) daylight saving time transition for the time zone.

[`func nextDaylightSavingTimeTransition(after: Date) -> Date?`](/documentation/Foundation/TimeZone/nextDaylightSavingTimeTransition(after:))

Returns the next daylight saving time transition after a given date.

### Describing Time Zones

[`func localizedName(for: TimeZone.NameStyle, locale: Locale?) -> String?`](/documentation/Foundation/TimeZone/localizedName(for:locale:))

Returns the name of the receiver localized for a given locale.

### Working with notification messages

[`struct SystemTimeZoneDidChangeMessage`](/documentation/Foundation/TimeZone/SystemTimeZoneDidChangeMessage)

A message the system sends when the system time zone changes.

### Using Reference Types

[`class NSTimeZone`](/documentation/Foundation/NSTimeZone)

Information about standard time conventions associated with a specific geopolitical region.

### Initializers

[`init?(abbreviation: String)`](/documentation/Foundation/TimeZone/init(abbreviation:))

Returns a time zone identified by a given abbreviation.

[`init?(identifier: String)`](/documentation/Foundation/TimeZone/init(identifier:))

Returns a time zone initialized with a given identifier.

### Type Aliases

[`typealias NameStyle`](/documentation/Foundation/TimeZone/NameStyle)

### Type Properties

[`static var gmt: TimeZone`](/documentation/Foundation/TimeZone/gmt)

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Escapable`](/documentation/Swift/Escapable)

[`ReferenceConvertible`](/documentation/Foundation/ReferenceConvertible)

[`Decodable`](/documentation/Swift/Decodable)

[`Copyable`](/documentation/Swift/Copyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Encodable`](/documentation/Swift/Encodable)

[`CustomReflectable`](/documentation/Swift/CustomReflectable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)