From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../objectes_globals/date/getfullyear/index.html | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 files/ca/web/javascript/referencia/objectes_globals/date/getfullyear/index.html (limited to 'files/ca/web/javascript/referencia/objectes_globals/date/getfullyear') diff --git a/files/ca/web/javascript/referencia/objectes_globals/date/getfullyear/index.html b/files/ca/web/javascript/referencia/objectes_globals/date/getfullyear/index.html new file mode 100644 index 0000000000..94f14f4332 --- /dev/null +++ b/files/ca/web/javascript/referencia/objectes_globals/date/getfullyear/index.html @@ -0,0 +1,121 @@ +--- +title: Date.prototype.getFullYear() +slug: Web/JavaScript/Referencia/Objectes_globals/Date/getFullYear +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear +--- +
{{JSRef("Global_Objects", "Date")}}
+ +

Resum

+ +

El mètode getFullYear() retorna l'any de la data especificada, en temps local.

+ +

Utilitzeu aquest mètode en comptes de {{jsxref("Date.prototype.getYear()", "getYear()")}}.

+ +

Sintaxi

+ +
dateObj.getFullYear()
+ +

Paràmetres

+ +

Cap.

+ +

Retorna

+ +

El valor retornat per getFullYear() és un nombre absolut. Per a dates entre els anys 1000 i 9999, getFullYear() retorna un nombre de 4 dígits (1995, per exemple). Utilitzeu aquesta funció per a assegurar-vos d'obtindre un any compatible amb l'efecte 2000.

+ +

Exemples

+ +

Exemple: Utilitzar getFullYear()

+ +

L'exemple següent assigna el valor de 4 dígits de l'any actual a la variable any.

+ +
var avui = new Date();
+var any = avui.getFullYear();
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
ECMAScript 1a Edició.StandardDefinició inicial. Implementat a 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')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf