Convert UTC NSDate into Local NSDate not working
问题 I have a string getting from server as "yyyy-MM-dd'T'HH:mm:ss.SSS'Z" I convert this string into NSDate by this formate. class func convertUTCDateToLocateDate(dateStr:String) -> NSDate{ let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" dateFormatter.timeZone = NSTimeZone(name: "UTC") let date = dateFormatter.dateFromString(dateStr) dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z" dateFormatter.timeZone = NSTimeZone.localTimeZone() let