getNowTimeStamp static method

int getNowTimeStamp(
  1. DateTime? date
)

获取时间戳,为空时为当前时间戳

Implementation

static int getNowTimeStamp(DateTime? date) {
  int? result;
  if (date != null) {
    result = date.millisecondsSinceEpoch;
  } else {
    result = DateTime.now().millisecondsSinceEpoch;
  }
  return result;
}