JS 두 날짜의 차이

두 날짜 간의 차이를 구해라.

1
2
3
4
5
6
7
8
9
let today = new Date(2112, 8, 24);
let start = new Date(2109, 7, 1);

function countDay(startDate) {
let timeDiff = today.getTime() - startDate.getTime();
let dayDiff = timeDiff / 1000 / 60 / 60 / 24;
}

countDay(start);

REFERENCE
코드잇 온라인 강의 프로그래밍 기초 in JavaScript

  • © 2020-2025 404 Not Found
  • Powered by Hexo Theme Ayer