Return the day of the week, according to universal time:
The result of n will be:
More "Try it Yourself" examples below.
The getUTCDay() method returns the day of the week (from 0 to 6) for the specified date, according to universal time.
Note: Sunday is 0, Monday is 1, and so on.
The UTC methods calculate their date assuming that the date object is of local time and date.
Tip: The Universal Coordinated Time (UTC) is the time set by the World Time Standard.
Note: UTC time is the same as GMT time.
Method | |||||
---|---|---|---|---|---|
getUTCDay() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | A Number, from 0 to 6, representing the day of the week |
---|---|
JavaScript Version: | 1.3 |
Return the name of the weekday (not just a number):
The result of n will be: