.getUTCDate()
The .getUTCDate()
returns the day of the month for the provided date according to universal time.
Syntax
myDate.getUTCDate()
The .getUTCDate()
method returns the day of the month as an integer (1-31) for the provided date myDate
.
Example
In the example below, the variable myDate
stores the day of the month returned from a new Date
object and logs the value to the console.
const myDate = new Date('2023-03-01');console.log(myDate.getUTCDate());
This results in the following output:
1
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.