Skip to content

Commit

Permalink
Update data
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicGamerRMG authored Jan 8, 2024
1 parent 67fa1b8 commit 26a1a64
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
// Set the date we're counting down to
const countdownDate = new Date("March 17, 2024 00:00:00").getTime();
const countdownDate = new Date("Febuary 17, 2024 00:00:00").getTime();

// Update the countdown every 1 second
const countdownElement = document.getElementById("countdown");

const countdownInterval = setInterval(() => {
const now = new Date().getTime();
const distance = countdownDate - now;

// Time calculations
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);

// Display the result
countdownElement.innerHTML = `${days}d ${hours}h ${minutes}m ${seconds}s`;

// If the countdown is over, clear the interval
if (distance < 0) {
clearInterval(countdownInterval);
countdownElement.innerHTML = "EXPIRED";
Expand Down

0 comments on commit 26a1a64

Please sign in to comment.