AMClockView
AMClockView copied to clipboard
Can I set the time to a specific time zone
I want to show a couple of instances of your control. How to I make each clock a different timezone?
I have tried this:
dateFormatter.locale = Locale(identifier: "en_US")
dateFormatter.dateFormat = "yyyy/MM/dd HH:mm"
dateFormatter.timeZone = TimeZone(abbreviation: "NZDT")
let nzdtDateString = dateFormatter.string(from: Date())
cView1.selectedDate = dateFormatter.date(from: nzdtDateString)
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
let gmtDate = dateFormatter.string(from: Date())
cView2.selectedDate = dateFormatter.date(from: gmtDate)
dateFormatter.timeZone = TimeZone(abbreviation: "EEST")
let eestDate = dateFormatter.string(from: Date())
print("EEST Time:", eestDate)
cView3.selectedDate = dateFormatter.date(from: eestDate)