English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript getUTCSeconds() method

 JavaScript Date Object

getUTCSeconds()Returns the number of seconds (0-59)

getUTCSeconds()The returned value is between 0 and59an integer.

World Standard Time (UTC) is the time standard set for world time.

For information about the minutes, seegetUTCMinutes()Method.

For information about the hour, seegetUTCHours()Method.

Syntax:

date.getUTCSeconds()
var d = new Date();
d.getUTCSeconds();
Test and see‹/›

Browser compatibility

All browsers fully support the getUTCSeconds() method:

Method
getUTCSeconds()isisisisis

Technical details

Return value:to59an integer between
JavaScript version:ECMAScript 1

More examples

Return the number of seconds for a specific date and time:

var d = new Date('July 30, 1992, 20:18:04 UTC'
d.getUTCSeconds();
Test and see‹/›

Display time using the getUTCHours(), getUTCMinutes(), getUTCSeconds(), and getUTCMilliseconds() methods:

setInterval(function () {
   var d = new Date();
   var x = document.getElementById('result'
   x.innerHTML = d.getUTCHours() + :" + d.getUTCMinutes() + :" + d.getUTCSeconds() + 
   ':' + d.getUTCMilliseconds();
}, 1);
Test and see‹/›

 JavaScript Date Object