67
JavaScript Date getUTCDate() method
The JavaScript date getUTCDate() method returns the day for the specified date on the basis of universal time.
Syntax
The getUTCDate() method is represented by the following syntax:
Return
An integer value between 1 and 31 that represents the day of the specified date.
JavaScript Date getUTCDate() method example
Here, we will understand getUTCDate() method through various examples.
Example 1
Let’s see an example to print today’s date according to universal time.
Output:
Today's day: 8
Example 2
Let’s see an example to print the day from the given date according to universal time.
Output:
Date value1 : 15 Date value2 : 16
Next TopicJavaScript Date