Naïve ISO8601 date parser, written in Swift.
You can parse ISO8601 date strings:
print(ISO8601.parse("1981-10-28T04:05:06.789Z"))
<NSDateComponents: 0x7fbe61d0f040>
TimeZone: GMT (GMT) offset 0
Calendar Year: 1981
Month: 10
Day: 28
Hour: 4
Minute: 5
Second: 6
You can convert NSDate
instances to a string:
print(date.toISO8601GMTString())
1971-02-03T09:16:06Z