Date.getDay()
Returns the day of the week (from 0-6)
var birthday = new Date('August 19, 1975 23:15:30');
var day1 = birthday.getDay();
// Sunday - Saturday : 0 - 6
console.log(day1);
// expected output: 2
Syntax
dateObj.getDay()Examples
Using getDay()
getDay()var Xmas95 = new Date('December 25, 1995 23:15:30');
var weekday = Xmas95.getDay();
console.log(weekday); // 1References
Contributors to this page
Last updated