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
```

Skip to content
# Php – Calculating days of week given a week number

###### Related Question

datephp

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
```

- Python – How to calculate number of days between two given dates
- Sql – Count work days between two dates
- Javascript – How to get the number of days between two dates in JavaScript
- Javascript – Add days to JavaScript Date
- Javascript – How to subtract days from a plain Date
- C# – Calculate difference between two dates (number of days)
- Php – Reference — What does this symbol mean in PHP
- Javascript – Calculate age given the birth date in the format YYYYMMDD
- C# – Get the correct week number of a given date

## Best Solution

PHPBelow 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: