Post

Replies

Boosts

Views

Activity

DateFormatter.date(from:) doesn't work in TimelineProvider.getTimeline(in:completion:)
It seems DateFormatter.date(from:) can't parse any date string in TimelineProvider.getTimeline(in:completion:) while DateFormatter.string(from:) works.         let formatter = DateFormatter()         formatter.locale = Locale(identifier: "en_US_POSIX")         formatter.dateFormat = "yyyyMMdd"         let date = formatter.date(from: "20201006")         let string = formatter.string(from: Date()) Result: date = (Date?) nil string = (String) "20201006" Is it a bug or am I doing wrong?
1
0
494
Oct ’20