fromMillisecondsSinceEpoch method

DateTime? fromMillisecondsSinceEpoch({
  1. bool isUtc = false,
})

毫秒时间戳转换 DateTime

Implementation

DateTime? fromMillisecondsSinceEpoch({bool isUtc = false}) {
  num n = this;
  if (n is! int) n = n.toInt();
  if (n.toString().length != 13) return null;
  return DateTime.fromMillisecondsSinceEpoch(n, isUtc: isUtc);
}