Guest User

blackmesa.js

a guest
Aug 15th, 2024
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
Add Comment
Please, Sign In to add comment