I need to know how to pass value to Dates () functions in JavaScript preferably spend minutes

0

I need to know how to pass value to Dates () functions in JavaScript preferably spend minutes?

<html>
    <head>
        <title>contagem regressiva</title>
    </head>
    <body>
        <script>
          a= new Date.getMinutes();
          console.log(a)   
        </script>
    </body>
</html>
    
asked by anonymous 24.04.2018 / 19:14

1 answer

0

Please see if this 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>
    
24.04.2018 / 19:31