[Zope-DB] Question on ZSQL and Dates

Charlie Clark charlie@begeistert.org
Wed, 23 Oct 2002 19:23:42 +0000


On 2002-10-23 at 16:16:32 [+0000], you wrote:
> In my experience, it's best to leave date handling up to database wheneve=
r
> possible.
> 
> select * from person where
> (sysdate - person.birthdate) > (45*365.25);
> 
> Hopefully someone will have a better solution for you.
sysdate doesn't seem to be available. I assume this is some DB-specific 
variable?

You seem to be implying that the DateTime object's basic unit is days but I=
 
think it's seconds. It might even be milliseconds... This would explain 
some of the results I'm getting by trial and error.

I've read somewhere that installing mxDateTime makes life a lot easier and 
I can believe it but I haven't yet worked out how to get Zope to use 
mxDateTime instead of DateTime. Stephan Richter's modules don't work on 
Zope 2.5.1

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
D=1Asseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226