I have an issue with TimeZone. I want get current time in my local, but I get wrong one. I set the time zone to TimeZone(identifier: "Asia/Baku")!
, but it's not working. it show me the time 11:25, but current time in my desktop and localized country is 15:25. this is my simple code:
let date = Date()
var calendar = Calendar.current
calendar.timeZone = TimeZone(identifier: "Asia/Baku")!
let components = calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
let currentDate = calendar.date(from: components)
print("Current Date: \(currentDate!)")