코드 :
today = new Date();
BigDay = new Date("December 25, 2020");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("2020년 12월 25일까지 " + daysLeft + " 일 " + hrsLeft +" 시간 " + minsLeft + " 분 남았습니다.");
등록된 댓글이 없습니다.