Date.prototype.getMilliseconds()

 

Il metodo getMilliseconds() restituisce i millisecondi nella data specificata in accordo con l'ora locale.

Sintassi

dateObj.getMilliseconds()

Valore di ritorno

Un numero, tra  0 e 999, rappresentante i millisecondi per la data fornita in accordo con l'ora locale.

Esempi

Utilizzando  getMilliseconds()

Il seguente esempio assegna la porzione di millisecondi del tempo corrente alla variabile milliseconds:

var today = new Date();
var milliseconds = today.getMilliseconds();

Specificazioni

Specification Status Comment
ECMAScript 1st Edition (ECMA-262) Standard Definizione iniziale. Implementata in JavaScript 1.3.
ECMAScript 5.1 (ECMA-262)
The definition of 'Date.prototype.getMilliseconds' in that specification.
Standard  
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Date.prototype.getMilliseconds' in that specification.
Standard  
ECMAScript Latest Draft (ECMA-262)
The definition of 'Date.prototype.getMilliseconds' in that specification.
Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
getMillisecondsChrome Full support YesEdge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes

Legend

Full support  
Full support

See also