Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setTimer(date) {
- function update() {
- const now = (new Date).getTime();
- const diffSeconds = Math.floor((date - now) / 1000);
- const elem = document.querySelector(".lambda-incident div p");
- elem.textContent = diffSeconds > 0 ? "" + diffSeconds : "That's it.";
- if (diffSeconds > 0) {
- setTimeout(update, 1000);
- }
- }
- update();
- }
- function makeDate(month, day, year, hour, minute, second) {
- return(new Date(month + " " + day + ", " + year + " " + hour + ":" + minute + ":" + second)).getTime();
- }
- const endDate = makeDate("September", 30, 2024, 23, 59, 59);
- setTimer(endDate);
Advertisement
Add Comment
Please, Sign In to add comment