maybeParseUtcMillis static method
Parses the given UTC Millis into a proper DateTime class. If the
value
cannot be processed then this will return null.
Implementation
static DateTime? maybeParseUtcMillis(dynamic value) {
DateTime? result;
int? input;
if (value is DateTime) {
result = value;
} else if (value is int) {
input = value;
} else if (value is String || value is double) {
input = JsonClass.maybeParseInt(value);
}
if (input != null) {
result = DateTime.fromMillisecondsSinceEpoch(
input,
isUtc: true,
);
}
return result;
}