Timestamp.fromMillisecondsSinceEpoch constructor

Timestamp.fromMillisecondsSinceEpoch(
  1. int milliseconds
)

Create a Timestamp fromMillisecondsSinceEpoch

Implementation

factory Timestamp.fromMillisecondsSinceEpoch(int milliseconds) {
  int seconds = (milliseconds / _kThousand).floor();
  final int nanoseconds = (milliseconds - seconds * _kThousand) * _kMillion;
  return Timestamp(seconds, nanoseconds);
}