Getting the timestamp from last saturday (every week)? – Here in this article, we will share some of the most common and frequently asked about PHP problem in programming with detailed answers and code samples. There’s nothing quite so frustrating as being faced with PHP errors and being unable to figure out what is preventing your website from functioning as it should like php and date . If you have an existing PHP-based website or application that is experiencing performance issues, let’s get thinking about Getting the timestamp from last saturday (every week)?.
first let me show you my code:
$lastWeek = date('m-d-Y', strtotime('-1 week'));
That’s how to get the timestamp from last week.
Is there a chance I gan get the timestamp from last saturday?
I hope you know what I mean.
Thanks a lot.
What’s wrong with
$last_sat = strtotime("last Saturday");
The time should be set to ’00:00:00′;
echo date('d-M-Y H:i:s',$last_sat);