Given a week number, e.g. date -u +%W, how do you calculate the days in that week starting from Monday?
Example rfc-3339 output for week 40:
2008-10-06 2008-10-07 2008-10-08 2008-10-09 2008-10-10 2008-10-11 2008-10-12
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.
PHP
Below post was because I was an idiot who didn’t read the question properly, but will get the dates in a week starting from Monday, given the date, not the week number..
In PHP, adapted from this post on the PHP date manual page:
Output from
week_from_monday('07-10-2008')gives: