[Zope] Inconsistent behaviour in DateTime comparisons

Bill Anderson bill@libc.org
01 Feb 2003 13:05:33 -0700


I've got a PostgreSQL DB with date fields, and am using ZpsycopgDa
(1.0.13) to connect Zope to it.

What I am needing to do is to compare "now" with a date filed stored in
the DB. I can get it out just fine, but the comparison is not
consistent.

I'm doing it in a a Script (Python).

(m is smartbrains-enhanced ZSQL result)
if DateTime().lessThan( m.expiresdate ):
 add m to a list
else:
 pass
return a list

Sometimes it returns correctly, others it returns the opposite of what I
want. Simply reloading the page has shown the switch happen -no change
to the script.

Any help appreciated.

Bill

-- 
Bill Anderson <bill@libc.org>
Linux in Boise Club