ISO8601DateFormatter doesn’t parse ISO date string
Prior to macOS 10.13 / iOS 11 ISO8601DateFormatter does not support date strings including milliseconds. A workaround is to remove the millisecond part with regular expression. let isoDateString = “2017-01-23T10:12:31.484Z” let trimmedIsoString = isoDateString.replacingOccurrences(of: “\\.\\d+”, with: “”, options: .regularExpression) let formatter = ISO8601DateFormatter() let date = formatter.date(from: trimmedIsoString) In macOS 10.13+ / iOS 11+ a … Read more