Javascript examples for Date:setUTCSeconds
Set both the seconds and milliseconds, according to UTC:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww . java 2 s . c om*/ var d = new Date(); d.setUTCSeconds(35, 825); var s = d.getUTCSeconds(); var ms = d.getUTCMilliseconds(); var x = document.getElementById("demo"); x.innerHTML = s + ":" + ms; } </script> </body> </html>