Metod getSeconds

Metod getSeconds se primenjuje na objekt sa datumom i vraća trenutnu vrednost sekundi (broj od 0 do 59).

Sintaksa

javascriptdatum.getSeconds();

Primer

Hajde da ispišemo trenutni broj sekundi:

javascriptlet datum = new Date();
let rez = datum.getSeconds();

console.log(rez);

Vidite takođe