dateToTimestamp static method

int? dateToTimestamp(
  1. DateTime? dateTime
)

Returns UTC seconds since epoch from a DateTime

Implementation

static int? dateToTimestamp(DateTime? dateTime) {
  if (dateTime == null) {
    return null;
  }
  return (dateTime.toUtc().millisecondsSinceEpoch /
          Duration.millisecondsPerSecond)
      .round();
}