The getUTCDay() method of JavaScript’s date object returns the day of the week of the specified date based on coordinated universal time. getUTCDay()The value returned is an integer corresponding to the day of the week: 0 represents Sunday, 1 represents Monday, 2 represents Tuesday, and so on.
You can try running the following code to return the day of the week for a specified date −
<html> <head> <title>JavaScript getUTCDay Method</title> </head> <body> <script> var dt = new Date( "January 15, 2018 20:15:20" ); document.write("getUTCDay() : " + dt.getUTCDay() ); </script> </body> </html>
The above is the detailed content of How to return the day of the week for a specified date based on UTC?. For more information, please follow other related articles on the PHP Chinese website!