.getUTCDay()
Anonymous contributor
Anonymous contributor1 total contribution
Anonymous contributor
Published Jun 14, 2023
Contribute to Docs
The .getUTCDay()
method returns the day of the week in the specified date according to universal time, as an integer value from 0 - 6 where 0 represents Sunday, 1 for Monday and so on.
Syntax
date_obj.getUTCDay();
The return value will give return an integer between 0 and 6:
- 0 = Sunday
- 1 = Monday
- 2 = Tuesday
- 3 = Wednesday
- 4 = Thursday
- 5 = Friday
- 6 = Saturday
Example
The following example shows the method in use.
const date = new Date('10 June 2023 14:15:30');console.log(date.getUTCDay());
This will result in the following output:
6
All contributors
- Anonymous contributorAnonymous contributor1 total contribution
- Anonymous contributor
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.