--- title: Date.prototype.getMilliseconds() slug: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds tags: - Date - JavaScript - Method - Prototype - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds --- <div>{{JSRef}}</div> <p>Die <strong><code>getMilliseconds()</code></strong> Methode gibt die Millisekunden eines Datums bezüglich der Ortszeit zurück.</p> <div>{{EmbedInteractiveExample("pages/js/date-getmilliseconds.html")}}</div> <h2 id="Syntax">Syntax</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getMilliseconds()</code></pre> <h3 id="Rückgabewert">Rückgabewert</h3> <p>Eine ganze Zahl zwischen 0 und 999, welche die Millisekunden der gegebenen Zeit bezüglich der lokalen Zeit angibt.</p> <h2 id="Beispiele">Beispiele</h2> <h3 id="Einsatz_von_getMilliseconds()">Einsatz von <code>getMilliseconds()</code></h3> <p>Im folgenden Beispiel wird die Variable <code>milliseconds</code> mit den aktuellen Millisekunden initialisiert:</p> <pre class="brush: js">var today = new Date(); var milliseconds = today.getMilliseconds(); </pre> <h2 id="Spezifikationen">Spezifikationen</h2> <table class="standard-table"> <tbody> <tr> <th scope="col">Spezifikation</th> <th scope="col">Status</th> <th scope="col">Kommentar</th> </tr> <tr> <td>{{SpecName('ES1')}}</td> <td>{{Spec2('ES1')}}</td> <td>Initiale Definition. Implementiert in JavaScript 1.3.</td> </tr> <tr> <td>{{SpecName('ES5.1', '#sec-15.9.5.24', 'Date.prototype.getMilliseconds')}}</td> <td>{{Spec2('ES5.1')}}</td> <td> </td> </tr> <tr> <td>{{SpecName('ES6', '#sec-date.prototype.getmilliseconds', 'Date.prototype.getMilliseconds')}}</td> <td>{{Spec2('ES6')}}</td> <td> </td> </tr> <tr> <td>{{SpecName('ESDraft', '#sec-date.prototype.getmilliseconds', 'Date.prototype.getMilliseconds')}}</td> <td>{{Spec2('ESDraft')}}</td> <td> </td> </tr> </tbody> </table> <h2 id="Browserkompatibilität">Browserkompatibilität</h2> <p>{{Compat("javascript.builtins.Date.getMilliseconds")}}</p> <h2 id="Siehe_auch">Siehe auch</h2> <ul> <li>{{jsxref("Date.prototype.getUTCMilliseconds()")}}</li> <li>{{jsxref("Date.prototype.setMilliseconds()")}}</li> </ul>