setMilliseconds Method (Date) (JavaScript)
JavaScript - Internet Explorer 10
Sets the milliseconds value in the Date object using local time.
dateObj.setMilliseconds(numMilli)
The following example illustrates the use of the setMilliseconds method.
function SetMSecDemo(nmsec){ var d, s; // Declare variables. d = new Date(); // Create Date object. d.setMilliseconds(nmsec); // Set milliseconds. s = "Current setting is "; s += d.toLocaleString(); s += " and " + d.getMilliseconds(); s += " milliseconds"; return(s); // Return new date setting. }
Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Also supported in Windows Store apps. See Version Information.
Applies To: Date Object (JavaScript)