formatDateTime function

String formatDateTime(
  1. DateTime date
)

date를 yyyy.MM.dd 오전/오후 hh:mm 형식으로 바꾼다.

Implementation

String formatDateTime(DateTime date) {
  return DateFormat(
    'yyyy.MM.dd a hh:mm',
  ).format(date).replaceAll('PM', '오후').replaceAll('AM', '오전');
}