Home » JavaScript Date getUTCDay() Method

JavaScript Date getUTCDay() Method

by Online Tutorials Library

JavaScript Date getUTCDay() method

The JavaScript date getUTCDay() method returns the value of day of the week for the specified date on the basis of universal time. The value of the day starts with 0 that represents Sunday.

Syntax

The getUTCDay() method is represented by the following syntax:

Return

An integer value between 0 and 6 that represents the days of the week for the specified date.

JavaScript Date getUTCDay() method example

Here, we will understand getUTCDay() method through various examples.

Example 1

Let’s see an example to print the value of today’s weekday according to universal time.

Test it Now

Output:

Day value : 3  

Example 2

Let’s see an example to print the value of weekday from the given date according to universal time.

Test it Now

Output:

Day value : 5  Day value : 6  
Next TopicJavaScript Date

You may also like