formatDateTime static method
dateTime 转 字符串 DateTime() => yyyy-MM-dd HH:mm:ss
Implementation
static String formatDateTime({DateTime? dateTime, String? pattern}) {
if (dateTime == null) dateTime = DateTime.now();
if (pattern == null) pattern = full;
return DateFormat(pattern).format(dateTime);
}