javaScript getUTCDay() Method

JavaScript: Date.getUTCDay() method; Through this tutorial, i am going to show you how to get UTC day of in javascript with the help of examples.

JavaScript getUTCDay() Method

Javascript getUTCDay() method is used to get the day of week for the specified date according to universal time. The getUTCDay method will return an integer value between 0 and 6.

Syntax of JavaScript getUTCDay() Method

 Date.getUTCDay()

Note: Sunday is 0, Monday is 1, Tuesday is 2 and so on.

Example of JavaScript getUTCDay() Method

See the following example of getUTCDay() method:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript date.getUTCDay Method</title>
</head>
<body>
  <script type = "text/javascript">
     var currentDate = new Date();
     document.write("the javascript date.getUTCDay() : " + currentDate.getUTCDay() ); 
  </script>  
</body>
</html>

Result of the above code is

JavaScript date.getUTCDay Method

Conclusion

In this javascript tutorial, you have learned how to get a day using getUTCDay function with example.

Recommended MySQL Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published.