date timer

yunsunji9·2021년 9월 7일
0
  function countDown(RemainDate) {
    const days = Math.floor(RemainDate / (1000 * 60 * 60 * 24));
    if (days > 0 ) return days + '일';
    const hours = Math.floor((RemainDate % (1000 * 60 * 60 * 24)) / (1000*60*60));
    const miniutes = Math.floor((RemainDate % (1000 * 60 * 60)) / (1000*60));
    const seconds = Math.floor((RemainDate % (1000 * 60)) / 1000);
    
    
    return numberPad(hours, 2) + ":" +  numberPad(miniutes, 2) + ":" + numberPad(seconds, 2);
  }

0개의 댓글