isValueInUnixEpochRange static method

bool isValueInUnixEpochRange(
  1. int value, [
  2. bool? inMilliseconds
])

Returns true if value is a UNIX epoch integer.

inMilliseconds consider epoch in milliseconds.

Implementation

static bool isValueInUnixEpochRange(int value, [bool? inMilliseconds]) {
  inMilliseconds ??= true;

  if (inMilliseconds) {
    return value > 946692000000 && value < 32503690800000;
  } else {
    return value > 946692000 && value < 32503690800;
  }
}