getMilliseconds()
JavaScript Date getMilliseconds() method
Last Updated : 17 Mar 2025
The JavaScript date getMilliseconds() method returns the value of milliseconds in specified date on the basis of local time.
Syntax
The getMilliseconds() method is represented by the following syntax:
Return
An integer value between 0 and 999 that represents milliseconds in specified date.
JavaScript Date getMilliseconds() method example
Here, we will understand getMilliseconds() method through various examples.
Example 1
Let's see an example to print current milliseconds.
Output:
Example 2
Let's see an example to print the value of milliseconds from the given time.
Output:
Example 3
Let's see an example to print complete current time.
Output: