반응형
Web Programming
-
-
JAVA 자바 날짜 차이 구하기
Web Programming 2023. 2. 22. 21:37자바 날짜 차이구하기 간단 예시 !! Date todayShow1 = new Date(); String chkDateShow1 = ""; SimpleDateFormat formatShow1; formatShow1 = new SimpleDateFormat("yyyyMMdd"); chkDateShow1 = formatShow1.format(todayShow1); String date1="20230504"; String date2=chkDateShow1; String date3="20230915"; DateFormat format = new SimpleDateFormat("yyyyMMdd"); /* Date타입으로 변경 */ Date d1 = format.parse( date1 ); Date d2 = form..