toLocalDateTime function
Converts value to DateTime in local time zone or throws FormatException if conversion fails.
Implementation
DateTime toLocalDateTime(dynamic value) =>
toLocalDateTimeOrNull(value) ??
(throw FormatException('Invalid DateTime value: $value'));