Given dayNumber is from 0 – 6 representing Monday – Sunday respectively.
Can the Date / String objects be used to get the day of the week from dayNumber?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will give you a day based on the index you pass:
Outputs “Today is Thursday”
You can alse get the current days index from JavaScript with
getDay()(however in this method, Sunday is 0, Monday is 1, etc.):Outputs 1 when it’s Monday.