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
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week