0

Attempting to get the first Monday of the first Week of the month. May 1st is a Sunday therefore the previous Monday is expected to be the first Monday.

$date = '2016-05-01';

$dateTimeObject = new DateTime($date, new DateTimeZone('Europe/London'));
$dateTimeObject->modify('first monday of this week');
echo $dateTimeObject->format('d');

However this echos 02 which is the following week's Monday when it should be April 25?

succeed
  • 739
  • 9
  • 22
  • Sunday would be the beginning of the week, so the first monday would be 2. – Devon Jun 26 '16 at 16:46
  • Is it possible to set Monday as beginning of the week? – succeed Jun 26 '16 at 16:47
  • 1
    Possible duplicate of [PHP DateTime() class, change first day of the week to Monday](http://stackoverflow.com/questions/13128854/php-datetime-class-change-first-day-of-the-week-to-monday) – Devon Jun 26 '16 at 16:52

0 Answers0