The getMilliseconds
function in JS is a method of the Date
class. The getMilliseconds
function returns the milliseconds part of the Date
object it is called on.
getMilliseconds()
The getMilliseconds
function takes no parameters.
0
to 999
that represents the milliseconds of the date object.The following code demonstrates the usage of the getMilliseconds
function:
let x = new Date('June 29, 2021 15:39:05:32');console.log(x.getMilliseconds());
In the example above, the Date
object x
has the date June 29, 2021 15:39:05:32
, where the value in milliseconds is 32
. When the function getMilliseconds
is called on x
, it returns this value.
Free Resources