Now you can listen to this article with the Online Text Reader


JavaScript getUTCMilliseconds Method





The getUTCMilliseconds method returns, according to universal time, the milliseconds since the last second of the point in time stored in a Date object. The value returned by this method is an integer number from 0 to 999.


Syntax

myDate.getUTCMilliseconds()

With myDate being an object based on the Date object.


Example

The following code uses the getUTCMilliseconds method to return, according to universal time, the milliseconds since the last second of the current point in time:

<script type="text/javascript">

var currentDate = new Date();
var universalMilliseconds = currentDate.getUTCMilliseconds();

document.write("According to universal time the milliseconds passed since the last second are: " + universalMilliseconds + ".");

</script>


Technical Details

The getUTCMilliseconds method belongs to the Date object, it is available since the version 1.3 of JavaScript, and it is supported in all major browsers.





JavaScript Manual >> Date Object >> getUTCMilliseconds Method





© Copyright 2010-2018 ROM Cartridge



Books to Read and Listen to Online