Get all Work Days in a Week for a given date

后端 未结 5 1743
萌比男神i
萌比男神i 2020-12-06 14:58

So I have one date as a string:

2011/06/01

I need to get the 5 DateTime objects from it that correspond to the five weekdays (Monday to Fri

5条回答
  •  無奈伤痛
    2020-12-06 15:35

    Try:

    $dayAfter = $dateTime->modify('+1 day');
    

    to get one day forward. For more information check the php manual on this class here.

提交回复
热议问题