aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html')
-rw-r--r--files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html92
1 files changed, 92 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html b/files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html
new file mode 100644
index 0000000000..d22f0d3346
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/date/toutcstring/index.html
@@ -0,0 +1,92 @@
+---
+title: Date.prototype.toUTCString()
+slug: Web/JavaScript/Reference/Objets_globaux/Date/toUTCString
+tags:
+ - Date
+ - JavaScript
+ - Méthode
+ - Prototype
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/toUTCString
+---
+<div>{{JSRef}}</div>
+
+<p>La méthode <code><strong>toUTCString()</strong></code> convertit une date en une chaîne de caractères, selon le fuseau horaire UTC.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/date-toutcstring.html")}}</div>
+
+<p class="hidden">Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuez à ces exemples, n'hésitez pas à cloner <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> et à envoyer une <em>pull request</em> !</p>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox"><var>dateObj</var>.toUTCString()</pre>
+
+<h3 id="Valeur_de_retour">Valeur de retour</h3>
+
+<p>Une chaîne de caractères représentant la date indiquée selon le fuseau horaire UTC.</p>
+
+<h2 id="Description">Description</h2>
+
+<p>La valeur renvoyée par <code>toUTCString()</code> est un texte au même format que celui renvoyé {{jsxref("Date.prototype.toString()")}} mais sans décalage de fuseau horaire (en UTC).</p>
+
+<p>Avant ECMAScript 2018, le format de la valeur renvoyée pouvait varier selon les plateformes. La valeur la plus couramment renvoyée était une date formatée selon la RFC 1123, qui est une version mise à jour de la RFC 822.</p>
+
+<h2 id="Exemples">Exemples</h2>
+
+<h3 id="Utiliser_toUTCString()">Utiliser <code>toUTCString()</code></h3>
+
+<pre class="brush: js">var aujourdhui = new Date();
+var UTCstring = aujourdhui.toUTCString();
+// Mon, 03 Jul 2006 21:44:38 GMT
+</pre>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">État</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Définition initiale. Implémentée avec JavaScript 1.3. Le format dépend de l'implémentation.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.9.5.42', 'Date.prototype.toUTCString')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-date.prototype.toutcstring', 'Date.prototype.toUTCString')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2018', '#sec-date.prototype.toutcstring', 'Date.prototype.toUTCString')}}</td>
+ <td>{{Spec2('ES2018')}}</td>
+ <td>Première standardisation du format</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.prototype.toutcstring', 'Date.prototype.toUTCString')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p class="hidden">Les données de compatibilité de ce tableau ont été générées à partir de données structurées. Si vous souhaitez contribuer à ces donnés, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</p>
+
+<p>{{Compat("javascript.builtins.Date.toUTCString")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{jsxref("Date.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Date.prototype.toDateString()")}}</li>
+ <li>{{jsxref("Date.prototype.toISOString()")}}</li>
+</ul>