getUTCSeconds()

Example 1:

For a Date object named myDate, use the following syntax:

var myDate = new Date()
var currSecs = myDate.getUTCSeconds()

Example 2:

For ranges 0 to 9, only 1 digit is returned. If you want to place a leading zero in front of the digit i.e. 01 to 09 seconds, do the following:

if (currSecs < 10)
{
 currSecs = "0" + currSecs)
}

Close