toLocalDateTime function

DateTime toLocalDateTime(
  1. dynamic value
)

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'));