Language Reference getSeconds Method


Description

Call this method to retrieve the number of seconds stored in the Date object.

Syntax

var intSeconds = objDate.getSeconds( )

Return Value

An integer between 0 and 59 indicating the seconds value of the indicated Date object.

Arguments

The getSeconds method has no arguments.

Remarks
The getSeconds method returns zero in two situations: the time is less than one second into the current minute, or the time was not stored in the Date object when the object was created. The only way to determine the difference is to also check the hours and minutes for zero values. If they are all zeroes, it is nearly certain that the time was not stored in the date object.