From an API I get the following two date strings. Those dates show the time of a weather observation of a weather station that’s located in some time zone.
dateUTC = "2019-06-14T18:00:00Z" dateLocal = "2019-06-14 20:00:00"
How can I determine the time zone the weather station is in? (Not the time zone of the user!)
I've tried to use the DateFormatter, but unfortunately the local date gets immediately transformed to GMT - and it's then identical with the UTC date.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
let dateUTC = dateFormatter.date(from: current.currentObservation[0].timeUTC)!
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
let dateLocal = dateFormatter.date(from: current.currentObservation[0].timeLocal)!
I would like to see as the result of the above date(s): Time zone = GMT+2