我尝试解析时间,但它一直返回nil。我错过了什么吗?
var datetime = "2015-07-14T09:00:00:+08:000"
var dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss:Z"
if let date : NSDate = dateFormatter.dateFromString(datetime){
var timeFormatter = NSDateFormatter()
timeFormatter.timeStyle = NSDateFormatterStyle.ShortStyle
let timeString = timeFormatter.stringFromDate(date)
xValues.addObject(timeString)
}
+08:000
的时区规范日期格式错误。只能是+08:00
,例如8hrs 0min