开发者

Getting the timestamp from last saturday (every week)?

开发者 https://www.devze.com 2023-02-09 01:54 出处:网络
first let me show you my code开发者_如何学Go: $lastWeek = date(\'m-d-Y\', strtotime(\'-1 week\'));

first let me show you my code开发者_如何学Go:

$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"); 

EDIT

The time should be set to '00:00:00';

echo date('d-M-Y H:i:s',$last_sat);

gives

29-Jan-2011 00:00:00
0

精彩评论

暂无评论...
验证码 换一张
取 消