我有此方法可以解析字符串Date:
let dateFormatterGet = DateFormatter()
let stringDate = "31/01/1965"
dateFormatterGet.dateFormat = "dd-MM-yyyy"
dateFormatterGet.locale = Locale(identifier: "pt_BR")
let birthDate = dateFormatterGet.date(from: stringDate)
print(birthDate)
如果Date是31/01/1965(January 31st),则birthDate返回nil,但是如果我将日期更改为30,则一切正常。怎么了?