I searched for hours, but I only found samples like this:
let dateString = "2020-03-02T19:37:00.073+01:00" //get from api
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = [
.withTimeZone,
.withInternetDateTime,
.withFractionalSeconds
]
print(dateFormatter.date(from: dateString) ?? "no valid date")
//2020-03-02 18:37:00 +0000
How can I formate this date like this:
02.03.2020 or 02.03.2020 18:37 (German format)
The method ISO8601DateFormatter() has no dateStyle property?
How can I display the formated date in a label?
Thanks