Metodo getSeconds
Il metodo getSeconds viene applicato a un
oggetto data
e restituisce il valore corrente dei secondi
(un numero da 0 a 59).
Sintassi
data.getSeconds();
Esempio
Visualizziamo il numero corrente di secondi:
let data = new Date();
let risultato = data.getSeconds();
console.log(risultato);
Vedi anche
-
metodo
getHours,
che ottiene le ore -
metodo
getMinutes,
che ottiene i minuti -
metodo
getSeconds,
che ottiene i secondi -
metodo
getMilliseconds,
che ottiene i millisecondi