I have the following string: 20180207T124600Z
20180207T124600Z
How can I turn this into a Date object?
Here is my current code but it returns nil:<
nil
You can use following function to get date...
func isodateFromString(_ isoDate: String) -> Date? { let formatter = DateFormatter() formatter.dateFormat = "yyyyMMdd'T'HHmmssZ" return formatter.date(from: isoDate) }