fromMicrosecondsSinceEpoch method

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

微秒时间戳转换 DateTime

Implementation

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