Back

dateObj.getUTCSeconds()

dateObj.getUTCSeconds()

The getUTCSeconds() method returns the seconds in the specified date according to universal time.

Syntax

dateObj.getUTCSeconds()

Parameters

None.

Return value

The value returned by getUTCSeconds() is an integer between 0 and 59.

Examples

Using getUTCSeconds()

The following example assigns the seconds portion of the current time to the variable seconds.

var today = new Date();
var seconds = today.getUTCSeconds();

  Created by Mozilla Contributors, license: CC-BY-SA 2.5