toDateStr method

String toDateStr({
  1. String format = 'yyyy-MM-dd HH:mm:ss',
})

毫秒转时间字符串

Implementation

String toDateStr({String format = 'yyyy-MM-dd HH:mm:ss'}) {
  final dateTime = DateTime.fromMillisecondsSinceEpoch(this);
  return DateFormat(format).format(dateTime);
}