The JavaScript date getDay() method is used to get the integer value between 0 and 6 that represents the day of the week based on the local time.
Syntax:
dateObj.getDay()
dateObj.getDay()
dateObj.getDay()
Return:
An integer value between 0 and 6.
Example:
<!DOCTYPE html>
<html>
<body>
<script>
var bday = new Date("March 16, 2018 21:00:10");
document.writeln(bday.getDay())
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<script>
var bday = new Date("March 16, 2018 21:00:10");
document.writeln(bday.getDay())
</script>
</body>
</html>
<!DOCTYPE html> <html> <body> <script> var bday = new Date("March 16, 2018 21:00:10"); document.writeln(bday.getDay()) </script> </body> </html>