The Setmilliseconds function method in JavaScript is to set the millisecond value in the Date object expressed in local time. How to use:
Dateobj.setmilliseconds (NumMilli)
Where Dateobj is a required option. Any Date object.
Nummilli is a mandatory option. is a number equal to the millisecond value.
To set the millisecond value in global standard Time (UTC), use the setUTCMilliseconds method. If the value of NumMilli is greater than 999 or negative, the number of seconds saved (as well as minutes, hours, and so on, if needed) will increase the appropriate number.
The following example illustrates the use of the Setmilliseconds function method in javascript:
function Setmsecdemo (nmsec) {
var d, S; Declares a variable. Www.82676666.com
var Sep = ":"; Initializes the delimiter.
D = new Date (); Creates a Date object.
D.setmilliseconds (NMSEC); Sets the number of milliseconds.
s = "current setting is";
s + = d.tolocalestring () + Sep + d.getmilliseconds ();
return (s); Returns the new date setting.
}
Setmilliseconds functions in JavaScript