I need to know how to pass value to Dates() functions in Javascript preference spend minutes

Asked

Viewed 18 times

0

I need to know how to pass value to Dates() functions in Javascript preference spend minutes?

<html>
    <head>
        <title>contagem regressiva</title>
    </head>
    <body>
        <script>
          a= new Date.getMinutes();
          console.log(a)   
        </script>
    </body>
</html>

1 answer

0


Please see if this way helps.

<html>
<head>
<script type="text/javascript">
function time()
{
today=new Date();
h=today.getHours();
m=today.getMinutes();
s=today.getSeconds();
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
setTimeout('time()',500);
}
</script>
</head>
<body onload="time()">
<div id="txt"></div>
</body>
</html>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.