JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow Date Right Arrow getMilliseconds()

getMilliseconds()  Date  instance method

Description

Returns the locale specific milliseconds (0-999) within the current second for the specified date.

Syntax


Signature Description
aDate.getMilliseconds()Returns the locale specific milliseconds (0-999) within the current second for the specified date.

Parameters

None.

Examples

The code below shows an example of the getMilliseconds() method of Date.





// Create a Date instance for the current date and time.
var todaysDate = new Date();
alert(todaysDate);

// Get milliseconds of the second.
alert(todaysDate.getMilliseconds() + ' = Milliseconds of the second');


Press the button below to action the above code:



Related Tutorials

JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times




  


go to home page Homepage go to top of page Top