我正在尝试打印日期和时间,但即使我设置了时区,我也会收到UTC时间。请记住,我正在使用军事时间。
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "MM/dd/yyyy hh:mm"
dateFormatter.timeZone = NSTimeZone.local
let someDate = dateFormatter.date(from: "\(mon)/\(day)/2016 \(hour):\(min)")
let secondDate = dateFormatter.date(from: "03/14/2016 11:20")