Date getUTCMilliseconds() Method - Javascript Date

Javascript examples for Date:getUTCMilliseconds

Description

The getUTCMilliseconds() method returns the milliseconds (from 0 to 999), according to universal time.

UTC time is the same as GMT time.

Parameters

None

Return Value:

A Number, from 0-999, representing milliseconds

The following code shows how to return the milliseconds, according to UTC:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*from w ww.ja va  2 s. c  o m*/
    var d = new Date("July 21, 2020 01:15:00:195");
    var n = d.getUTCMilliseconds();
    document.getElementById("demo").innerHTML = n;
}
</script>

</body>
</html>

Related Tutorials