how to get the day name from date in javascript

162

how to get the day name from date in javascript -

var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var d = new Date(dateString);
var dayName = days[d.getDay()];

Comments

Submit
0 Comments