Okay, so I’ve been hyped for Zenless Zone Zero, like, really hyped. The trailers looked amazing, and I just couldn’t wait. So, I decided to make a countdown timer to keep track of the release, because, you know, patience is not my strong suit.
Getting Started
First, I needed to figure out the actual release date. I already knew it. Easy peasy!
Coding it Up
Next, I had to, you know, actually make the thing. I’m not some coding wizard, I just copy some example code from somewhere, and modified a little bit.
I used the following function:
function updateCountdown() {
const releaseDate = new Date('July 4, 2024 10:00:00 GMT+8');
const now = new Date();
const diff = releaseDate - now;
const days = *(diff / (1000 60 60 24));
const hours = *((diff % (1000 60 60 24)) / (1000 60 60));
const minutes = *((diff % (1000 60 60)) / (1000 60));
const seconds = *((diff % (1000 60)) / 1000);
*('countdown').innerHTML = `
<div>${days} <span>Days</span></div>
<div>${hours} <span>Hours</span></div>
<div>${minutes} <span>Minutes</span></div>
<div>${seconds} <span>Seconds</span></div>
if (diff <= 0) {
*('countdown').innerHTML = "<div>Game Released!</div>";
clearInterval(interval);
updateCountdown();
const interval = setInterval(updateCountdown, 1000);
I just set the date and boom, basic timer working.
Tidying Up (a little)
I put that code on my computer. You know, simple stuff. And… that was pretty much it. Nothing fancy. Not really.
The Result
It works! I now have a little countdown timer ticking away, reminding me how many days, hours, minutes, and even seconds until I can dive into Zenless Zone Zero. Mission accomplished, I guess. It is keeping me aware!