liamloveslearning Posted June 28, 2010 Share Posted June 28, 2010 Hi all, I have a photo gallery, in my showcase I want to show only photos uploaded this week, Im currently filtering my command using BETWEEN $mystartdate AND $myenddate <?php $startdate = date('Y-m-d', strtotime ("last Sunday")); $enddate = date('Y-m-d', strtotime ("next Saturday")); ?> Only when it comes to sunday it shows all photos makred to show in the future, if this makes sense? How can i filter this to say show all photos between last sunday and the sunday coming? or if its currently a sunday, show all photos uploaded between last sunday and today? Link to comment https://forums.phpfreaks.com/topic/206039-date-filter/ Share on other sites More sharing options...
liamloveslearning Posted June 28, 2010 Author Share Posted June 28, 2010 I think this works... <?php $startdate = date('Y-m-d', strtotime ("last Sunday")); $enddate = date('Y-m-d', strtotime("now")); ?> Link to comment https://forums.phpfreaks.com/topic/206039-date-filter/#findComment-1078089 Share on other sites More sharing options...
Alex Posted June 28, 2010 Share Posted June 28, 2010 $enddate = date('Y-m-d', strtotime("now")); Would be the same as.. $enddate = date('Y-m-d'); Link to comment https://forums.phpfreaks.com/topic/206039-date-filter/#findComment-1078091 Share on other sites More sharing options...
salathe Posted June 28, 2010 Share Posted June 28, 2010 Maybe I'm misunderstanding, but don't you always want the photos between last Sunday and today? Link to comment https://forums.phpfreaks.com/topic/206039-date-filter/#findComment-1078102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.