Now you can listen to this article with the Online Text Reader

JavaScript getUTCDate Method

The getUTCDate method returns, according to universal time, the day of the month of the point in time stored in a Date object. The value returned by this method is an integer number from 1 to 31.



With myDate being an object based on the Date object.


The following code uses the getUTCDate method to return the day of the month for the current date according to universal time:

<script type="text/javascript">

var currentDate = new Date();
var universalDayInTheMonth = currentDate.getUTCDate();
document.write("The current day of the month according to universal time is: " + universalDayInTheMonth + ".");


Technical Details

The getUTCDate method belongs to the Date object, it is available since the version 1.3 of JavaScript, and it is supported in all major browsers.

JavaScript Manual >> Date Object >> getUTCDate Method

© Copyright 2010-2018 ROM Cartridge

Books to Read and Listen to Online