Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert /web/javascript/reference/global_objects/date folder to Markdown (es) #8168

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Date.prototype.getDate()
slug: Web/JavaScript/Reference/Global_Objects/Date/getDate
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate
original_slug: Web/JavaScript/Referencia/Objetos_globales/Date/getDate
---
{{JSRef}}

El método **`getDate()`** devuelve el día del mes para la fecha especificada de acuerdo con la hora local.

## Sintaxis

dateObj.getDate()

### Parámetros

Ninguno.

### Valor de retorno

El valor devuelto por `getDate() es u`n número entero, entre 1 y 31, que representa el día del mes para la fecha dada según la hora local.

## Ejemplos

### Uso de `getDate()`

La segunda instrucción asigna el valor 25 a la variable `day`, en función del valor del objeto {{jsxref("Date")}} `Xmas95`.

```js
var Xmas95 = new Date('December 25, 1995 23:15:30');
var day = Xmas95.getDate();

console.log(day); // 25
```

## Especificaciones

| Especificación | Estado | Comentario |
| ---------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------------------------- |
| {{SpecName('ES6', '#sec-date.prototype.getdate', 'Date.prototype.getDate')}} | {{Spec2('ES6')}} | |
| {{SpecName('ES5.1', '#sec-15.9.5.14', 'Date.prototype.getDate')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implantado en JavaScript 1.1. |

## Compatibilidad con navegadores

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

## Véase también

- {{jsxref("Date.prototype.getUTCDate()")}}
- {{jsxref("Date.prototype.getUTCDay()")}}
- {{jsxref("Date.prototype.setDate()")}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Date.prototype.getDay()
slug: Web/JavaScript/Reference/Global_Objects/Date/getDay
tags:
- Date
- JavaScript
- Prototype
- metodo
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay
original_slug: Web/JavaScript/Referencia/Objetos_globales/Date/getDay
---
{{JSRef}}

`El método `**`getDay()`** devuelve el día de la semana de la fecha especificada en función de la fecha local; siendo 0 (Domingo) el primer día.

## Sintaxis

dateObj.getDay()

### Parámetros

Ninguno.

### Valor devuelto

El valor devuelto por `getDay()` es un entero correspondiente al día de la semana; siendo 0 (Domingo) el primer día, 1 (Lunes) el segundo, etcétera.

## Ejemplos

### `Usos de getDay()`

La segunda sentencia asigna el valor 1 a `weekday, `basado en el valor del objeto Xmas95 {{jsxref("Date")}}. December 25, 1995, que corresponde a Lunes.

```js
var Xmas95 = new Date('December 25, 1995 23:15:30');
var weekday = Xmas95.getDay();

console.log(weekday); // 1
```

## Especificaciones

| Especificación | Estado | Comentario |
| ---------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------------------- |
| {{SpecName('ES6', '#sec-date.prototype.getday', 'Date.prototype.getDay')}} | {{Spec2('ES6')}} | |
| {{SpecName('ES5.1', '#sec-15.9.5.16', 'Date.prototype.getDay')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implementado en JS 1.0. |

## Compatibilidad con navegadores

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

## Ver también

- {{jsxref("Date.prototype.getUTCDate()")}}
- {{jsxref("Date.prototype.getUTCDay()")}}
- {{jsxref("Date.prototype.setDate()")}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Date.prototype.getFullYear()
slug: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
tags:
- Fecha
- JavaScript
- Prototipo
- Referencia
- metodo
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
original_slug: Web/JavaScript/Referencia/Objetos_globales/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`.

```js
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

- {{jsxref("Date.prototype.getUTCFullYear()")}}
- {{jsxref("Date.prototype.setFullYear()")}}
- {{jsxref("Date.prototype.getYear()")}}
Loading