fromSecondsSinceEpoch static method

DateTime fromSecondsSinceEpoch(
  1. int secondsSinceEpoch, {
  2. bool isUtc = false,
})

Number of seconds since epoch time / A.K.A Unix timestamp

The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970).

Implementation

static DateTime fromSecondsSinceEpoch(
  int secondsSinceEpoch, {
  bool isUtc = false,
}) =>
    DateTime.fromMillisecondsSinceEpoch(
      secondsSinceEpoch * 1000,
      isUtc: isUtc,
    );