[thelist] CF date comparison problem

Oliver Lineham oliver at lineham.co.nz
Fri Jan 12 20:33:31 CST 2001


At 11:17 13/01/2001 +1030, you wrote:

>show.showdate >= now()
[..]
>Now: {ts '2001-01-12 19:38:40'}
>Show date: 2001-01-13 00:00:00

you can see why it is thinking now() is after the showdate, since the time 
part of showdate is set to midnight.

the easiest way around this is to use DateCompare() instead of >=

eg.  DateCompare(show.showdate, now(), "d")

the "d" makes it precise to the day.

DateCompare will return -1 if showdate is less than now, 0 if it is today, 
or 1 if it is after today.

</ol>

____________________________________________________
  phone +64 21 210-7845       http://www.vibe.co.nz/
  po box 10-492              wellington, new zealand




More information about the thelist mailing list