Date.getUTCDate()

JavaScript 1.2+, ECMAScript 1.0+, JScript 3.0+ Nav4+, IE 4+ Syntax

							date.getUTCDate()

Description

The getUTCDate() method returns the day of the month converted to universal time and expressed as an integer from 1 to 31.

Example

The code in Listing 6.81 displays the day of the month in universal time using the getUTCDate() method.

Listing 6.81 Using the getUTCDate() Method to Return the Day of the Month
<html>

<script language="JavaScript">
<!-- Hide
							
							

//Create a Date object that contains the current date and time.
theDate = new Date();

//Display the UTC date
document.write("The UTC date is ",theDate.getUTCDate());

//Hide End -->
</script>

</html>
							
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.