How to get a user’s time zone?

edit/update: Xcode 8 or later • Swift 3 or later var secondsFromGMT: Int { return TimeZone.current.secondsFromGMT() } secondsFromGMT // -7200 if you need the abbreviation: var localTimeZoneAbbreviation: String { return TimeZone.current.abbreviation() ?? “” } localTimeZoneAbbreviation // “GMT-2” if you need the timezone identifier: var localTimeZoneIdentifier: String { return TimeZone.current.identifier } localTimeZoneIdentifier // “America/Sao_Paulo” To know … Read more