JavaScript Date setMilliseconds() Method
- Previous Page setHours()
- Next Page setMinutes()
- Go to the Previous Level JavaScript Date Reference Manual
Definition and Usage
setMilliseconds()
Method to set the milliseconds of a date object.
Example
Set milliseconds to 192:
var d = new Date(); d.setMilliseconds(192); var n = d.getMilliseconds();
Syntax
Date.setMilliseconds(millisec)
Parameter Value
Parameter | Description |
---|---|
millisec |
Required. An integer representing milliseconds. The expected value is 0-999, but other values are allowed:
|
Technical Details
Return Value: | A number representing the milliseconds between the date object and midnight on January 1, 1970. |
---|---|
JavaScript Version: | ECMAScript 1 |
Browser Support
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
setMilliseconds() | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Date
Tutorial:JavaScript Date Format
Tutorial:JavaScript Date Setting Methods
- Previous Page setHours()
- Next Page setMinutes()
- Go to the Previous Level JavaScript Date Reference Manual