JavaScript getUTCMilliseconds

JavaScript getUTCMilliseconds Date Function returns the Milliseconds on a given date according to universal time. The syntax of the JavaScript getUTCMilliseconds function is:

 Date.getUTCMilliseconds()

JavaScript getUTCMilliseconds Function Example

We used the getUTCMilliseconds function to return the total milliseconds as per the universal time from the current date and time.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScript Get UTC Milliseconds Function </title>
</head>
<body>
    <h1> JavaScript getUTCMilliseconds Function Example </h1>
<script>
  var dt = Date();  
  document.write("Date and Time : " + dt);
  document.write("UTC Milliseconds using getUTCMilliseconds : " + dt.getUTCMilliseconds());
</script>
</body>
</html>
JavaScript getUTCMilliseconds 1

JavaScript get UTC Milliseconds Function Example 2

In this example for JavaScript get UTC Milliseconds, we are displaying the Milliseconds from the custom date and time as per universal time.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScript Get UTC Milliseconds Function </title>
</head>
<body>
    <h1> JavaScript getUTCMilliseconds Function Example </h1>
<script>
  var dt = Date("April 1, 2017 10:12:22.0716");
  document.write("Date and Time : " + dt);
  document.write("UTC Milliseconds using getUTCMilliseconds : " + dt.getUTCMilliseconds());
</script>
</body>
</html>
JavaScript getUTCMilliseconds Example

Date and Time: Sat Apr 01 2017 10:12:22 GMT+0530 (Indian Standard Time)
UTC Milliseconds using getUTCMilliseconds(): 71