parseOrNullWithFormat static method
Returns the value converted from date
to format
.
If conversion fails, null is returned.
Implementation
static DateTime? parseOrNullWithFormat(String date, String format) {
try {
return intl.DateFormat(format).parseStrict(date);
} catch (e) {
return null;
}
}