如何从字符串返回预定义时区的NSDate
原文链接:https://www.f2er.com/swift/319050.htmllet responseString = "2015-8-17 GMT+05:30" var dFormatter = NSDateFormatter() dFormatter.dateFormat = "yyyy-M-dd ZZZZ" var serverTime = dFormatter.dateFromString(responseString) println("NSDate : \(serverTime!)")
上面的代码返回时间为
2015-08-16 18:30:00 +0000