0

Thank you in advance

I searched for so many solutions but I did not get what I need

For an example - I want to get all the weeks and it's a start date and end date

Like if I say September-2020 then I need all the weeks with start and end date

The output should like below (Monday should be the first day of a week so the week is from Monday-Sunday)

Week 1 ->  2020-08-31 To  2020-09-06
Week 2 ->  2020-09-07 To  2020-09-13
Week 3 ->  2020-09-14 To  2020-09-20
Week 4 ->  2020-09-21 To  2020-09-27
Week 5 ->  2020-09-28 To  2020-10-04
Ronak Solanki
  • 341
  • 2
  • 5
  • 14
  • 1
    What have you tried? See this: https://stackoverflow.com/help/how-to-ask – flomei Sep 07 '20 at 13:02
  • Can you please share that what is missing in my question if anything you feel like? – Ronak Solanki Sep 07 '20 at 13:11
  • 1
    @RonakSolanki please share effort that you put into solution finding, did you write any lines of code that we can try improve? How do you want to detect first Monday of any month? – Krzysztof Safjanowski Sep 07 '20 at 13:35
  • `(new \DateTimeImmutable())->modify("first day of this month")` will modify the datetime to current months first day. – Code Spirit Sep 07 '20 at 13:41
  • Does this answer your question? [The first day of the current month in php using date\_modify as DateTime object](https://stackoverflow.com/questions/2094797/the-first-day-of-the-current-month-in-php-using-date-modify-as-datetime-object) – Code Spirit Sep 07 '20 at 13:41
  • Hello all, i don't want the first day of month i want all the weeks for a month and it's week's start and end date as shown at last in this question – Ronak Solanki Sep 08 '20 at 04:33
  • I think the question has already been answered here: https://stackoverflow.com/questions/57463978/date-first-monday-of-first-week-of-month – jspit Sep 08 '20 at 08:19

0 Answers0