toLocalTime method

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

转成当地时间

Implementation

DateTime toLocalTime({bool isUtc = false}) {
  if (isNullOrZero) {
    return DateTime.now();
  }
  int mSTime = this ?? 0;
  if ("$this".length == 10) {
    mSTime = this ?? 0 * 1000;
  }
  return DateTime.fromMillisecondsSinceEpoch(mSTime, isUtc: isUtc).toLocal();
}