Date.prototype.toUTCString()
Die toUTCString()
Methode konvertiert ein Date
in einen String. Dabei wird die UTC Zeitzone verwendet.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
dateObj.toUTCString()
Rückgabewert
Ein String, der das gegebene Date
Objekt mit Zuhilfenahme der UTC Zeitzonen repräsentiert.
Beschreibung
Der Rückgabewert der toUTCString()
Methode ist ein für menschen lesbarer String, der die UTC Zeitzone nutzt. Das Format des zurückgegebenen String kann von Plattform zu Plattform variieren. Der am häufigsten eingesetzte Wert ist ein RFC-1123 formatierter Zeitstempel, welcher ein Update des Zeitstempels in der Version RFC-822 ist.
Beispiele
Einsatz von toUTCString()
var today = new Date('Wed, 14 Jun 2017 00:00:00 PDT');
var UTCstring = today.toUTCString(); // Wed, 14 Jun 2017 07:00:00 GMT
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initiale Definition. Implementiert in JavaScript 1.3. |
ECMAScript 5.1 (ECMA-262) Die Definition von 'Date.prototype.toUTCString' in dieser Spezifikation. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Date.prototype.toUTCString' in dieser Spezifikation. |
Standard | |
ECMAScript (ECMA-262) Die Definition von 'Date.prototype.toUTCString' in dieser Spezifikation. |
Lebender Standard |
Browserkompatibilität
BCD tables only load in the browser
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.