setUTCDate() method sets the day of the month for a
specified date according to universal time.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
- An integer from 1 to 31, representing the day of the month.
The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date.
If a parameter you specify is outside of the expected range,
attempts to update the date information in the
Date object accordingly.
For example, if you use 40 for
dayValue, and the month stored in the
Date object is June, the day will be changed to 10 and the month will be
incremented to July.
var theBigDay = new Date(); theBigDay.setUTCDate(20);
The definition of 'Date.prototype.setUTCDate' in that specification.
BCD tables only load in the browser