Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Click the button to display the day of the week, according to UTC.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var d = new Date(); var weekday = new Array(7); weekday[0] = "Sunday"; weekday[1] = "Monday"; weekday[2] = "Tuesday"; weekday[3] = "Wednesday"; weekday[4] = "Thursday"; weekday[5] = "Friday"; weekday[6] = "Saturday"; var n = weekday[d.getUTCDay()]; document.getElementById("demo").innerHTML = n; } </script> <p><strong>Note:</strong> 0=Sunday, 1=Monday, etc.</p> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_date_weekday_utc by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:26:58 GMT --> </html>
Result:
Try it Yourself - © w3schools.com