setUTCDate(date)
Sets the day of the month for the UTC date.
If the date is greater than the number of days in the month, the month value also
gets increased.
UTC time is the same as GMT time.
setUTCDate() |
Yes | Yes | Yes | Yes | Yes |
dateObject.setUTCDate(day);
Parameter | Description |
---|---|
day | Required. An integer representing the day of a month.
Expected values are 1-31, but other values are allowed: If the month has 31 days, 32 will be the first day of the next month. |
return a number representing the number of milliseconds between the date value and midnight January 1 1970.
var myDate = new Date();
myDate.setUTCDate(23);
console.log(myDate.toString());
The code above generates the following result.