Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 셀렉트박스 커스텀
- Router
- 검색
- 앵귤러 모달
- Ionic modal
- Angular Router
- summary
- route
- 옵저버블
- 모달
- Oracle LISTAGG 사용 예시
- mysql if
- angular modal
- prisma
- 앵귤러 애니메이션
- 아이오닉 스크롤 이벤트
- modal
- angular button
- 스크롤 이벤트 감지
- 호버
- formgroup
- angular route
- angular animation
- ajax 사용 예시
- flex-1
- egov spring ajax 사용 예시
- ApexChart
- scroll
- TAILWIND
- 스크롤 이벤트
Archives
- Today
- Total
깜놀하는 해므찌로
Java 자바 두 날짜 차이 계산 예시 본문
반응형
SMALL
/* 날짜 포멧 */
String searchStartDate = searchVO.getSearchStartDate();
String searchEndDate = searchVO.getSearchEndDate();
/* 포멧 형식 셋팅 */
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd");
/* 포멧 */
Date startDate = (Date) formatter.parse(searchStartDate);
Date endDate = (Date) formatter.parse(searchEndDate);
/* 두 날짜 차이 계산 */
System.out.println((endDate.getTime() - startDate.getTime())/(1000 * 60 * 60 * 24));
int length = (int)(endDate.getTime() - startDate.getTime())/(1000 * 60 * 60 * 24);
반응형
LIST
'IT' 카테고리의 다른 글
Oracle LISTAGG 사용 예시 / [직급]이름(시간) 테이블 4개 참조 예시 (0) | 2022.08.23 |
---|---|
java.lang.Integer cannot be cast to 에러 해결 (0) | 2022.08.23 |
java.util.Date cannot be cast to java.sql.Date 에러 해결 (0) | 2022.08.21 |
Unparseable date: "" 에러 해결 feat.JAVA (0) | 2022.08.20 |
Oracle Between 사용 예시 (0) | 2022.08.19 |