JavaScript Date getDay() methodThe JavaScript date getDay() method returns the value of day of the week for the specified date on the basis of local time. The value of the day starts with 0 that represents Sunday. SyntaxThe getDay() method is represented by the following syntax: ReturnAn integer value between 0 and 6 that represents the days of the week for the specified date. JavaScript Date getDay() method exampleHere, we will understand getDay() method through various examples. Example 1Let's see an example to print the value of today's weekday. Test it NowOutput: 1 Example 2Let's see an example to print the value of weekday from the given date. Test it NowOutput: 5 Next TopicJavaScript Math |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India