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
- The Date Type and Time Intervals
- Calendar and DateComponents
- Formatting Dates
- Time Zones and Locales