Easy Tutorial
❮ Event Key Which Prop Img Longdesc ❯

JavaScript setMilliseconds() Method

JavaScript Date Object

Example

Set the milliseconds field to 192 for a specified time:

n Output result:


Definition and Usage

The setMilliseconds() method is used to set the milliseconds field for a specified time.


Browser Support

All major browsers support the setMilliseconds() method.


Syntax

Parameter Values

Parameter Description
millisec Required. Used to set the milliseconds field of the dateObject. This parameter is an integer between 0 and 999: -1 is the last millisecond of the previous second<br> 1000 is the first millisecond of the next second<br> 1001 is the second millisecond of the next second

Return Value

Type Description
Number The number of milliseconds from midnight of January 1, 1970, to the adjusted date.

Technical Details

| JavaScript Version: | 1.3 | | --- | --- |


JavaScript Date Object

❮ Event Key Which Prop Img Longdesc ❯