CodesJava

Easy learning with example program codes

JavaScript Date getDay() method

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()

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>

Output:

5
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status