如何创建日期时间戳和格式为ISO 8601,RFC 3339,UTC时区?
"2015-01-01T00:00:00.000Z"
NSDate
, NSDateFormatter
, NSTimeZone
.
var now = NSDate()var formatter = NSDateFormatter()formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" formatter.timeZone = NSTimeZone(forSecondsFromGMT: 0)println(formatter.stringFromDate(now))