Countdown Time and seconds

Source: Internet
Author: User
Tags time and seconds

<!doctype html>

<meta charset= "Utf-8" >

<title> Countdown JS Code </title>

<body>

Countdown JS Code

<div id= "countmsg" class= "Hotdate" >

<span id= "T_d" >00 Day </span>

<span id= "T_h" >00 </span>

<span id= "T_m" >00 points </span>

<span id= "t_s" >00 sec </span>

</DIV>

<script type= "Text/javascript" >

function Getrtime () {

var endtime= new Date (' 2016/05/27 10:00:00 '); Cut-off time on the front road

var nowtime = new Date ();

var t =endtime.gettime ()-nowtime.gettime ();

/*var D=math.floor (T/1000/60/60/24);

t-=d* (1000*60*60*24);

var h=math.floor (T/1000/60/60);

t-=h*60*60*1000;

var m=math.floor (T/1000/60);

t-=m*60*1000;

var s=math.floor (t/1000); */

var d=math.floor (T/1000/60/60/24);

var h=math.floor (t/1000/60/60%24);

var m=math.floor (t/1000/60%60);

var s=math.floor (t/1000%60);

document.getElementById ("T_d"). InnerHTML = d + "Day";

document.getElementById ("T_h"). InnerHTML = h + "when";

document.getElementById ("T_m"). InnerHTML = m + "min";

document.getElementById ("t_s"). InnerHTML = s + "s";

}

SetInterval (getrtime,1000);

</script>

</body>

Countdown Time and seconds

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.