How to use getUTCMilliseconds in JavaScript

In this article, I will explain use of getUTCMilliseconds() method in JavaScript date object.
  • 1446

JavaScript date getUTCMilliseconds() method

  • getMilliseconds() method of date object returns the milliseconds of the specified date according to local time according to universal time.

  • In getMilliseconds() method, The returned value is number between 0 and 999.




In the following example show to getUTCMilliseconds() method returns current time millisecond according to universal time..

<!DOCTYPE html>



<h3 style="color:red">JavaScript getUTCMilliseconds() Method Example</h3>

<p id="demo">Click for display milliseconds, according to UTC.</p>

<button onclick="myFunction()">Try it</button>

<script type="text/javascript">

    function myFunction() {

        var d = new Date();

        var x = document.getElementById("demo");

        x.innerHTML=document.write("According to UTC, Current Millisecond is: " + d.getUTCMilliseconds());






getUTCMillesecond 1.jpg


getUTCMillesecond 2.jpg

You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.