currentDateString static method

String currentDateString()

当前日期字符串 2021-06-20

Implementation

static String currentDateString() {
  DateTime dateTime = DateTime.now();
  int year = dateTime.year;
  int month = dateTime.month;
  int day = dateTime.day;
  return format2Number(year.toString()) + "-" + format2Number(month.toString()) + "-" + format2Number(day.toString());
}