A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds below:

Date.prototype.getSeconds() - JavaScript | MDN

Date.prototype.getSeconds()

Baseline Widely available

La méthode getSeconds() renvoie les secondes pour la date renseignée d'après l'heure locale.

Exemple interactif
const moonLanding = new Date("July 20, 69 00:20:18");

console.log(moonLanding.getSeconds());
// Expected output: 18
Syntaxe Valeur de retour

La valeur renvoyée par getSeconds() est un entier entre 0 et 59 correspondant au nombre de secondes pour la date donnée selon l'heure locale.

Exemples Utiliser getSeconds()

La seconde instruction ci-dessous assigne la valeur 30 à la variable secondes, selon la valeur de l'objet Date noel95.

var noel95 = new Date("December 25, 1995 23:15:30");
var secondes = noel95.getSeconds();

console.log(secondes); //30
Spécifications Compatibilité des navigateurs Voir aussi

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4