In the user registry I have an input with a mask in this format "dd / MM / YY", after getting the input value, which comes as string, I have to convert it to date. The conversion always worked, only with the date 10/25/1992 that it's the problem and always returns nil. The code I'm using is this:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd/MM/yyyy"
if let dateString = birthDayInput.text { // 25/10/1992
return dateFormatter.date(from: dateString) // nil
}
return nil