2012. 1. 12. 10:32
SimpleDateFormat 예제 Java2012. 1. 12. 10:32
// 년도, 월, 날짜만 출력
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd");
simpleDateFormat.format(msgDate);
// 오전 또는 오후라고 나옴. ex) 오후
SimpleDateFormat isAmFormat = new SimpleDateFormat("aa");
isAmFormat.format(msgDate);
// 시간, 분 출력 ex) 11:13
SimpleDateFormat currentDateSimpleDateFormat = new SimpleDateFormat("hh:mm");
currentDateSimpleDateFormat.format(currentDate);
댓글을 달아 주세요