Dateformatter issue in swift
问题 My API sending me date string in UTC like 2/20/2016 11:45 AM. For displaying date in my timezone, I am converting date from UTC to Local time zone like below code let sourceDateString = "12/20/2016 11:45 AM" let formatter = DateFormatter() formatter.dateFormat = "MM/dd/yyyy hh:mm a" formatter.timeZone = TimeZone(identifier: "UTC") let date = formatter.date(from: sourceDateString) print(date) formatter.timeZone = NSTimeZone.local formatter.dateFormat = "MMM dd,yyyy hh:mm a" let strDate =