JavaScript getUTCSeconds() | Get the UTC Seconds

The JavaScript getUTCSeconds() method is used to get the seconds (0-59) of the UTC time. UTC stands for Universal Time Coordinated which is same as Greenwich Mean Time (GMT). Here is an example of the getUTCSeconds() to print the seconds of the UTC time:

HTML with JavaScript Code
<!DOCTYPE html>
   <p id="xyz"></p>

      const d = new Date();
      let min = d.getUTCSeconds();
      document.getElementById("xyz").innerHTML = min;


JavaScript getUTCSeconds() Syntax

The syntax of getUTCSeconds() method in JavaScript is:


where x must be an object of the Date() constructor.

The getUTCSeconds() method returns a number from 0 to 59 which will be the seconds of a date.

JavaScript Online Test

« Previous Tutorial Next Tutorial »

Like/Share Us on Facebook 😋