JavaScript getUTCSeconds()Method

Date 对象参考手册JavaScript Date Object

Example

Return the seconds of a time according to universal time:

var d = new Date();
var n = d.getUTCSeconds();

Try it Yourself »

Definition and Usage

The getUTCSeconds() method returns the seconds of a time according to universal time (0~59).

Coordinated Universal Time (UTC) is a time measurement system based on the length of an atomic second, keeping as close as possible to universal time.

Tip:Coordinated Universal Time, also known as World Unified Time, World Standard Time, International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).

Note:UTC time is the same as GMT (Greenwich) time.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the getUTCSeconds() method


Syntax

Date.getUTCSeconds()

Return Value

Type Description
Number Returns its seconds field, which is an integer between 0 and 59.

Technical Details

JavaScript Version: 1.3


实例s

More Examples

Display the current UTC time
How to use getUTCHours(), getUTCMinutes(), and getUTCSeconds() to display the current UTC time.


Date 对象参考手册JavaScript Date Object

Other Extensions