diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:23 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
| commit | bf8e099b9c8b3c60d60b3712b4fc97b052c39887 (patch) | |
| tree | c101746d082c9581c94f5937519c7d0e2f4af8cb /files/fr/web/javascript/reference/global_objects/date/getfullyear | |
| parent | 844f5103992238c0c23203286dad16a466e89c97 (diff) | |
| download | translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.gz translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.bz2 translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/date/getfullyear')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/date/getfullyear/index.md | 90 |
1 files changed, 33 insertions, 57 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/date/getfullyear/index.md b/files/fr/web/javascript/reference/global_objects/date/getfullyear/index.md index 16d862b7e3..d3cf612ee7 100644 --- a/files/fr/web/javascript/reference/global_objects/date/getfullyear/index.md +++ b/files/fr/web/javascript/reference/global_objects/date/getfullyear/index.md @@ -10,72 +10,48 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear original_slug: Web/JavaScript/Reference/Objets_globaux/Date/getFullYear --- -<div>{{JSRef}}</div> +{{JSRef}} -<p>La méthode <code><strong>getFullYear()</strong></code> renvoie l'année de la date renseignée d'après l'heure locale.</p> +La méthode **`getFullYear()`** renvoie l'année de la date renseignée d'après l'heure locale. -<p>Cette méthode doit être utilisée à la place de {{jsxref("Date.prototype.getYear()", "getYear()")}}.</p> +Cette méthode doit être utilisée à la place de {{jsxref("Date.prototype.getYear()", "getYear()")}}. -<div>{{EmbedInteractiveExample("pages/js/date-getfullyear.html")}}</div> +{{EmbedInteractiveExample("pages/js/date-getfullyear.html")}} -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox">dateObj.getFullYear()</pre> + dateObj.getFullYear() -<h3 id="Valeur_de_retour">Valeur de retour</h3> +### Valeur de retour -<p>Un entier correspondant à l'année de la date selon l'heure locale.</p> +Un entier correspondant à l'année de la date selon l'heure locale. -<h2 id="Exemples">Exemples</h2> +## Exemples -<h3 id="Utiliser_getFullYear()">Utiliser <code>getFullYear()</code></h3> +### Utiliser `getFullYear()` -<p>L'exemple qui suit assigne la valeur à quatre chiffres de l'année courante à la variable <code>année</code>.</p> +L'exemple qui suit assigne la valeur à quatre chiffres de l'année courante à la variable `année`. -<pre class="brush: js">var aujd = new Date(); +```js +var aujd = new Date(); var année = aujd.getFullYear(); -</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.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.9.5.10', 'Date.prototype.getFullYear')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.Date.getFullYear")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li> - <li>{{jsxref("Date.prototype.setFullYear()")}}</li> - <li>{{jsxref("Date.prototype.getYear()")}}</li> -</ul> +``` + +## Spécifications + +| Spécification | État | Commentaires | +| -------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------- | +| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Définition initiale. Implémentée avec JavaScript 1.3. | +| {{SpecName('ES5.1', '#sec-15.9.5.10', 'Date.prototype.getFullYear')}} | {{Spec2('ES5.1')}} | | +| {{SpecName('ES6', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}} | {{Spec2('ES6')}} | | +| {{SpecName('ESDraft', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}} | {{Spec2('ESDraft')}} | | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.Date.getFullYear")}} + +## Voir aussi + +- {{jsxref("Date.prototype.getUTCFullYear()")}} +- {{jsxref("Date.prototype.setFullYear()")}} +- {{jsxref("Date.prototype.getYear()")}} |
