View difference between Paste ID: 091KB37u and BZgG0TF0
SHOW: | | - or go back to the newest paste.
1
function setTimer(date) {
2
  function update() {
3
    const now = (new Date).getTime();
4
    const diffSeconds = Math.floor((date - now) / 1000);
5
    const elem = document.querySelector(".lambda-incident div p");
6
    elem.textContent = diffSeconds > 0 ? "" + diffSeconds : "That's it.";
7
    if (diffSeconds > 0) {
8
      setTimeout(update, 1000);
9
    }
10
  }
11
  update();
12
}
13
 
14
function makeDate(month, day, year, hour, minute, second) {
15
  return(new Date(month + " " + day + ", " + year + " " + hour + ":" + minute + ":" + second)).getTime();
16
}
17
const endDate = makeDate("September", 30, 2024, 23, 59, 59);
18
setTimer(endDate);
19