fromTimestamp static method

DateTime fromTimestamp(
  1. Timestamp value, {
  2. bool isUtc = true,
})

Converts a Protobuf db.Timestamp value to a Dart core DateTime.

Implementation

static DateTime fromTimestamp(
  pb.Timestamp value, {
  bool isUtc = true,
}) =>
    DateTime.fromMillisecondsSinceEpoch(
      (value.seconds.toInt() * 1000) + (value.nanos ~/ 1000),
      isUtc: isUtc,
    );