var format = new DateFormat('y-MM-dd HH:mm'); var regDate = new DateTime.fromMicrosecondsSinceEpoch(int.parse(rows[index]['reg_date']) * 1000); print(format.format(regDate));
rows[index]['reg_date']은 JSON에서 가져온 데이터 목록의 유닉스타임 값이고, String값이었기 때문에 int로 형변환을 해줬다.
*DateFormat 은 아래 문서를 참고하면 된다.
https://pub.dartlang.org/documentation/intl/latest/intl/DateFormat-class.html
새댓글 등록