strtotime using string "first day of last week" not correct
Posted: 05 Nov 2020, 06:35
Using the code:
returns: "2020-10-01 00:00:00", when I expect it to return "2020-10-25 00:00:00".
Why is it returning the first day of the month?
How can I get the first day of last week (and also the last day of last week)?
Code: Select all
$from_date = date('Y-m-d 00:00:00', strtotime('first day of last week'));
echo $from_date; // 2020-10-01 00:00:00
Why is it returning the first day of the month?
How can I get the first day of last week (and also the last day of last week)?