From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- .../global_objects/date/getfullyear/index.html | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/es/web/javascript/reference/global_objects/date/getfullyear/index.html (limited to 'files/es/web/javascript/reference/global_objects/date/getfullyear') diff --git a/files/es/web/javascript/reference/global_objects/date/getfullyear/index.html b/files/es/web/javascript/reference/global_objects/date/getfullyear/index.html new file mode 100644 index 0000000000..0d047fbbc3 --- /dev/null +++ b/files/es/web/javascript/reference/global_objects/date/getfullyear/index.html @@ -0,0 +1,67 @@ +--- +title: Date.prototype.getFullYear() +slug: Web/JavaScript/Referencia/Objetos_globales/Date/getFullYear +tags: + - Fecha + - JavaScript + - Prototipo + - Referencia + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear +--- +
{{JSRef}}
+ +

El método getFullYear() devuelve el año de la fecha indicada acorde a la hora local.

+ +

Usa este método en lugar del método {{jsxref("Date.prototype.getYear()", "getYear()")}}.

+ +
{{EmbedInteractiveExample("pages/js/date-getfullyear.html","shorter")}}
+ +

Sintaxis

+ +
dateObj.getFullYear()
+ +

Valor devuelto

+ +

Un número correspondiente al año de la fecha indicada, según la hora local.

+ +

Descripción

+ +

El valor devuelto por getFullYear() es un número absoluto. Para fechas entre los años 1000 y 9999, getFullYear() devuelve un número de cuatro cifras, por ejemplo, 1995. Utiliza esta función para obtener un año que cumpla con los años posteriores al 2000.

+ +

Ejemplos

+ +

Utilizando getFullYear()

+ +

El siguiente ejemplo asigna el valor de cuatro dígitos del año actual a la variable year.

+ +
var today = new Date();
+var year = today.getFullYear();
+
+ +

Especificaciones

+ + + + + + + + + + + + +
Especificación
{{SpecName('ESDraft', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}}
+ +

Compatibilidad con navegadores

+ +

{{Compat("javascript.builtins.Date.getFullYear")}}

+ +

Ver también

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