Use to calculate the countdown to a given time. Note that the currentTime and endTime should both be in the same local timezone.
Returns an object with days, hours, minutes, seconds.
const now = new Date();const endTime = new Date('2021-06-20 03:34:00 UTC');const countDown = time.countdown(now, endTime);countdown.days; // the number of dayscountdown.hours; // the number of hourscountdown.minutes; // the number of minutescountdown.seconds; // the number of seconds Copy
const now = new Date();const endTime = new Date('2021-06-20 03:34:00 UTC');const countDown = time.countdown(now, endTime);countdown.days; // the number of dayscountdown.hours; // the number of hourscountdown.minutes; // the number of minutescountdown.seconds; // the number of seconds
Use to calculate the countdown to a given time. Note that the currentTime and endTime should both be in the same local timezone.
Returns an object with days, hours, minutes, seconds.