ES6 - getSeconds() Method


Advertisements


JavaScript date getSeconds() method returns the seconds in the specified date according to local time. The value returned by getSeconds is an integer between 0 and 59.

Syntax

Date.getSeconds ()   

Return Value

Returns the seconds in the specified date according to local time.

Example

var dt = new Date("December 25, 1995 23:15:00"); 
console.log("getSeconds() : " + dt.getSeconds() );  

Output

getSeconds() : 0 

es6_date.htm

Advertisements