how to set timer for 1 hour?

5/5 - (1 vote)

Today, We want to share with you timer 1 hour.In this post we will show you The simplest possible JavaScript countdown timers?, hear for 1 hour timers with music we will give you demo and example for implement.In this post, we will learn about Javascript Timed Redirect With Countdown with an example.

Free Live Chat for Any Issue

Online 1 hour 30 minute timer – Stopwatch & Timers

here i learn to 1 hour timers – online timers with countdown using JavaScript with HTML Code. Set alarm for 1 hour ⏰ as well as wake up in time. Free and simply to use countdown timers.

Read Also:  PHP Laravel 6 Custom Error Page Example

HTML Code

<div id="countdown"></div>
<div id="countdown2"></div>

JavaScript Code

function countdown( elementName, minutes, seconds )
{
    var element, endTime, hours, mins, msLeft, time;

    function twoDigits( n )
    {
        return (n <= 9 ? "0" + n : n);
    }

    function updateTimer()
    {
        msLeft = endTime - (+new Date);
        if ( msLeft < 1000 ) {
            element.innerHTML = "countdown's over!";
        } else {
            time = new Date( msLeft );
            hours = time.getUTCHours();
            mins = time.getUTCMinutes();
            element.innerHTML = (hours ? hours + ':' + twoDigits( mins ) : mins) + ':' + twoDigits( time.getUTCSeconds() );
            setTimeout( updateTimer, time.getUTCMilliseconds() + 500 );
        }
    }

    element = document.getElementById( elementName );
    endTime = (+new Date) + 1000 * (60*minutes + seconds) + 500;
    updateTimer();
}

countdown( "countdown", 1, 5 );
countdown( "countdown2", 100, 0 );

Download

style.css

div {
    color: #1B232F;
    font-family: Verdana, Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
}