Home >>JavaScript Date Object Methods >JavaScript getUTCDate() Method

JavaScript getUTCDate() Method

JavaScript getUTCDate() Method

The getUTCDate() method is an inbuilt function in JavaScript which returns the day of the month in the specified date (from 1 to 31) according to universal time from a given object. Note that UTC time is the same as GMT time.

Syntax:
Date.getUTCDate()

Browser Support

Method Chrome Edge Firefox Safari Opera
getUTCDate() Yes Yes Yes Yes Yes
Here is an Example of JavaScript getUTCDate() Method:
<html>
<body>
<button onclick="myGetUTC()">Click me</button>
<p id="Utcdate"></p>
<script>
function myGetUTC() 
{
  var d = new Date();
  var a = d.getUTCDate();
  document.getElementById("Utcdate").innerHTML = a;
}
</script>
</body>
</html>
Output:

Example 2:
<html>
<body>
<button onclick="myUTC()">Click me</button>
<p id="UTC1"></p>
<script>
function myUTC() 
{
  var d = new Date("July7, 1997 02:28:00");
  var c = d.getUTCDate();
  document.getElementById("UTC1").innerHTML = c;
}
</script>
</body>
</html>
Output: