DateFormatter gives one hour earlier
0
I have a problem with dateformatter. I want parse date, but I always get one hour earlier The image is from http://nsdateformatter.com/ where I tried parse date which I put to date in a result, but I always get an hour earlier. I need get 18:18:46 , but I always get 17:18:46 My code which doesn't work: extension Date { func getString() -> String { var calendar = Calendar.current calendar.locale = Locale(identifier: Bundle.main.preferredLocalizations[0]) let dateFormatter = DateFormatter() dateFormatter.calendar = calendar dateFormatter.timeZone = TimeZone.current dateFormatter.dateFormat = "d.M.yyyy, HH:mm:ss" return dateFormatter.string(from: self) } } Thank you for your answers.
...