[Zope] date comparison

Tino Wildenhain tino@wildenhain.de
Mon, 13 Mar 2000 03:29:39 +0100


Michel Pelletier wrote:
> 
> Kyle Burnett wrote:
> >
> > anyone know a quick way to compare two date strings without having to
> > complete tear the string apart?
> 
> Use the DateTime Object, in python:
> 
> Py$ from DateTime import DateTime
> Py$ DateTime() > DateTime('Jan 1, 1999')
> 1
> Py$
> 
> in DTML:
> 
> <dtml-if "_.DateTime() > _.DateTime('Jan 1, 1999')">
>   True.
> </dtml-else>
>   You should never see this unless the universe reversed itself.
> </dtml-if>
> 
Yeah ;) But whats with comparing wether we are between hour xx and hour
yy 
every day? Or even between 0:00 and 1:15 every day...
This comes up with very strange hassle with DateTime() and strings and
int() 
and so on...

Or is there a better way?

Best regards
Tino Wildenhain