toDateTime static method
Implementation
static DateTime? toDateTime({
required String date,
required String inputFormat,
}) {
DateTime? dateTime;
try {
dateTime = DateFormat(inputFormat).parse(date);
} catch (e) {
dateTime = null;
}
return dateTime;
}