Countdown Timer App

Countdown Timer App

What is Countdown Timer:

A countdown timer displays the number of days , minutes, seconds are left for the specified day. It acts like a virtual clock that reminds the time left . The main purpose of the countdown timer is to indicate the beginning or end of the event.

Countdown Timer App:

Countdown timer App is a interactive web application which allows users to set a countdown for specific date and time for the upcoming event. It provides the visual representation of time left for the date. It uses the HTML(Hypertext Markup Language) for creating the countdown timer app.

Users can specify the date as the input and the countdown timer dynamically calculates the time left  in the form of days, hours, minutes and seconds. The input is in the form of date (month and date), year and time. The output is shown as EXPIRED if the countdown is completed.

The key features of the countdown timer app are :

  • It provides a user friendly interface allowing the uses to set the time and date.
  • It displays the real-time countdown .It dynamically calculates the time left in the form of days, hours, minutes and seconds remaining.
  • It enables the users to  set the target date and time .

 

HTML code for Countdown Timer App

<html>
<head>
<title>Countdown Timer</title>
</head>
<body>
<h1 align="center">Countdown Timer App</h1>
</body>
<p align="center" id="demo"></p>
<script>
var countDownDate = new Date("Jan 6, 2025 12:00:00").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML = days + " days  " + hours + " hours "+ minutes + " minutes " + seconds + " seconds ";
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
} }, 1000);
</script>
</html>

 

OUTPUT

 

Countdown Timer App

 

212 days 14hours 2 minutes 10 seconds

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top