0Pricing
Swift Academy · Lesson

Time Zones and Locales

Handle zone and locale differences correctly.

Time Zones and Locales

The same Date instant displays differently around the world. TimeZone and Locale decide how it is interpreted and shown.

TimeZone Basics

A TimeZone represents an offset from UTC plus daylight-saving rules. TimeZone.current is the device's zone.

import Foundation

let tz = TimeZone.current
print("Identifier present: \(!tz.identifier.isEmpty)")

All lessons in this course

  1. The Date Type and Time Intervals
  2. Calendar and DateComponents
  3. Formatting Dates
  4. Time Zones and Locales
← Back to Swift Academy