Description
The setMilliseconds() method sets the milliseconds (from 0 to 999), according to local time.
This method has the form:
Date.setMilliseconds(millisec)
Parameter | Description |
---|---|
millisec | (required) An integer between 0 and 999 representing the milliseconds |
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
d.setMilliseconds(100);
document.write(d.getMilliseconds());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|