How to get the day of the week in JS. I want something similar to PHP's date('w'), but i've not found anything like that... Any help will be highly appreciated
You use getDay() function The return value is from 0 to 6 0->Sunday 1->Monday ... 6->Saturday If you need to return string like "Mon" rather than value 1 of getDay(), you need to make a array: weekdays = new Array("Sun","Mon","Tue","Wed,"Thu","Fri","Sat"); Then get string value from weekdays[d.getDay()]
Yep, I found it. Thank you anyway koolman I was stuck on calculating stuff using getDate() and apparently i've missed getDay() several times when reading the documentation...