IT잡아먹기/JAVA

JAVA 날짜 포맷 변경

린애 2015. 12. 29. 11:26

// 날짜 포맷 변경
SimpleDateFormat sdftime = new SimpleDateFormat("yyyy-MM-dd a h:mm");


Date nowDate = new Date();


Date expiryDate = sdftime.parse(sdftime.format(rs.getTimestamp(4)), new ParsePosition(0));


 -> sdftime.parse(sdftime.format(DB Result Set), new ParsePosition(0));)

nowDate.before(expiryDate) // 현재가 만료기간보다 이전일때