stringToDate() returns null if formatted string date has invalid values