Jump to content

Issues with date filtering


Jimbos
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...