getUTCDate()
Returns the day of the month (1 through 31)
for the UTC date.
UTC time is the same as GMT time.
getUTCDate() |
Yes | Yes | Yes | Yes | Yes |
dateObject.getUTCDate();
None.
return a number, from 1 to 31, representing the day of the month.
var myDate = new Date();
console.log(myDate.getUTCDate());
The code above generates the following result.
The following code shows how to get the UTC day of the month of a specific, local time, date-time:
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {<!-- www.ja va2 s . c o m-->
var d = new Date("July 12, 1976 01:23:00");
var n = d.getUTCDate();
document.getElementById("demo").innerHTML = n;
}
</script>
</body>
</html>
The code above is rendered as follows: