Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

getMilliseconds Method

Returns the milliseconds value in a Date object using local time.

function getMilliseconds() : Number

Remarks

To get the number of milliseconds in Coordinated Universal Time (UTC), use the getUTCMilliseconds method.

The millisecond value returned can range from 0-999.

Example

The following example illustrates the use of the getMilliseconds method.

function TimeDemo(){
   var d, s = "The current local time is: ";
   var c = ":";
   d = new Date();
   s += d.getHours() + c;
   s += d.getMinutes() + c;
   s += d.getSeconds() + c;
   s += d.getMilliseconds();
   return(s);
}

Requirements

Version 3

See Also

getUTCMilliseconds Method | setMilliseconds Method | setUTCMilliseconds Method

Applies To: Date Object

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.