I use the following code to convert a string into a date:
// Input is "06-10-18, 01:30 pm"
func convertStringToDate(string: String) -> Date {
let formatter = DateFormatter()
formatter.dateFormat = "dd-MM-yyyy, hh:mm a"
return formatter.date(from: string)!
}
This works fine on simulators and my devices, however it crashes on return for a couple of client devices.
I tried seeing what was wrong by making it return a string from a date, and on the client devices it returns this:
"06-10-18, 13:30"
Why is it returning differently on a handful of devices?