Jimbos Posted October 11, 2022 Share Posted October 11, 2022 Hello, I've a problem with date filtering: this query works: $today = date("Y-m-d", strtotime('today')); $pages->find("template=page, sort=datetime, datetime>=$today"); but this not: $today = date("Y-m-d", strtotime('tomorrow')); $pages->find("template=page, sort=datetime, datetime<=$tomorrow"); why? Thank you!! Link to comment Share on other sites More sharing options...
zoeck Posted October 11, 2022 Share Posted October 11, 2022 inside a selector you have to use a timestamp ? Just use strtotime without date(), i think it should work ? <?php $today = strtotime('tomorrow'); $pages->find("template=page, sort=datetime, datetime<=$tomorrow"); Link to comment Share on other sites More sharing options...
Jimbos Posted October 11, 2022 Author Share Posted October 11, 2022 Thank you zoeck, never works, it seems a problem related to the datetime field. Filter the pages through this field doesn't works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now