As the title says, I'd like to get in PHP last week's Saturday date and current week's Saturday date with the constraint of a week starting with Saturday instead of Monday.
I first used strtotime('saturday last week') and strtotime('saturday this week') or new DateTime("saturday last week") and new DateTime("saturday this week") but it obviously doesn't give the expected result as the week starts with Monday.
So for example, if today is 2024-03-04, the result should be :
- last Saturday: 2024-02-24
- this Saturday: 2024-03-02
What would be the simplest way to do that?
EDIT: To make it simple, I'm trying to get the first day of the current and previous week for weeks that start with Saturday.
Источник: https://stackoverflow.com/questions/781 ... ith-monday