setUTCMilliseconds()
Date
instance method setterS2C Home
« Globals « Date « setUTCMilliseconds()
Description
Sets the UTC milliseconds (0-999) for the specified date.
Syntax
Signature | Description |
---|---|
aDate.setUTCMilliseconds(millisecondsInt) | Sets the UTC milliseconds (0-999) for the specified date. |
Parameters
Parameter | Description |
---|---|
millisecondsInt | An integer in the range 0-999.
|
Examples
The code below shows examples of the setUTCMilliseconds()
method of Date
.
// Create a Date instance for the current date and time.
var todaysDate = new Date();
alert(todaysDate);
// Set and display some dates.
todaysDate.setUTCMilliseconds(100000);
alert(todaysDate + ' - UTC milliseconds set to 100000');
todaysDate.setUTCMilliseconds(10000000000);
alert(todaysDate + ' - UTC milliseconds set to 10000000000');
Related Tutorials
JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times