--- title: Date.prototype.getMilliseconds() slug: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds ---
Il metodo getMilliseconds()
restituisce i millisecondi nella data specificata in accordo con l'ora locale.
dateObj.getMilliseconds()
Un numero, tra 0 e 999, rappresentante i millisecondi per la data fornita in accordo con l'ora locale.
getMilliseconds()
Il seguente esempio assegna la porzione di millisecondi del tempo corrente alla variabile milliseconds
:
var today = new Date(); var milliseconds = today.getMilliseconds();
Specification | Status | Comment |
---|---|---|
{{SpecName('ES1')}} | {{Spec2('ES1')}} | Definizione iniziale. Implementata in JavaScript 1.3. |
{{SpecName('ES5.1', '#sec-15.9.5.24', 'Date.prototype.getMilliseconds')}} | {{Spec2('ES5.1')}} | |
{{SpecName('ES6', '#sec-date.prototype.getmilliseconds', 'Date.prototype.getMilliseconds')}} | {{Spec2('ES6')}} | |
{{SpecName('ESDraft', '#sec-date.prototype.getmilliseconds', 'Date.prototype.getMilliseconds')}} | {{Spec2('ESDraft')}} |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("javascript.builtins.Date.getMilliseconds")}}