Date Search

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 27, 2010   (RSS)

Re: [sykomac] Date Search

By Dave - January 27, 2010

Hi sykomac,

Try this:
$today = date('Y-m-d H:i:s');

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [sykomac] Date Search

By sykomac - January 27, 2010

I haven't tried that yet, but my date fields are stored as just a date and no time.

Re: [Dave] Date Search

By sykomac - January 27, 2010

Dave,

Well, I had to do two things --

1 - I had to change the date to the format you gave me.

2 - I had to change the order of the single and double quotes in the where clause to:

'where' => "startdate <= '$today' AND enddate >= '$today'"

(Double quote at the start and end and single quotes around the variable $today.

Thanks,