getNowTime static method

String? getNowTime(
  1. DateTime? date
)

获取时间,为空时为当前时间 (默认为yyyy-MM-dd HH:mm:ss)

Implementation

static String? getNowTime(DateTime? date) {
  DateTime? result;
  if (date != null) {
    result = date;
  } else {
    result = DateTime.now();
  }
  return getTime(dateTime: result);
}