댓글 검색 목록

[javascript] 주어진 두 날짜 사이의 일 수 구하기

페이지 정보

작성자 운영자 작성일 18-01-04 16:37 조회 1,218 댓글 0

코드 : 

const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
  (dateFinal - dateInitial) / (1000 * 3600 * 24);


예 : 

getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9일


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.