El m茅todo getSeconds()
devuelve los segundos en la fecha especificada de acuerdo a la hora local.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Sintaxis
dateObj.getSeconds()
Valor devuelto
Un n煤mero entero, entro 0 y 59, representando los segundos en la fecha dada de acuerdo a la hora local.
Ejemplos
Utilizando getSeconds()
La segunda sentencia asigna el valor 30 a la variable seconds
, en base al valor del objeto Date
Xmas95
.
var Xmas95 = new Date('December 25, 1995 23:15:30');
var seconds = Xmas95.getSeconds();
console.log(seconds); // 30
Especificaciones
Especificaci贸n | Estado | Comentario |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Definici贸n inicial. Implementado en JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) La definici贸n de 'Date.prototype.getSeconds' en esta especificaci贸n. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) La definici贸n de 'Date.prototype.getSeconds' en esta especificaci贸n. |
Standard | |
ECMAScript (ECMA-262) La definici贸n de 'Date.prototype.getSeconds' en esta especificaci贸n. |
Living Standard |
Compatibilidad con navegadores
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.