[Zope] PrincipiaTime with MS-Access ODBC data SOLUTION

Brad Clements bkc@murkworks.com
Fri, 5 Feb 1999 10:49:21 -0400


On 5 Feb 99, at 15:58, Christian Tismer wrote:

> Brad Clements wrote:
> > 
> > I have an Access database that I get to via ODBC. One of the columns is
> > type "Date/Time".
> 
> This means that you get a DbiDate object, assuming that you use 
> the standard odbc interface.
> 
> I looked into the DateTime.py module. It appears to me as if
> it tries to build a DateTime from such a dbi object.
> 
> > 
> > I want to see if a record is "recent", as in the previous 7 days.
> > 
> > I've tried various things, where DocumentTime is the Date/Time field
> > type...
> > 
> > <!--#if "PrincipiaTime() - PrincipiaTime(DocumentTime) < 7"-->


The solution was very simple

<!--#if DocumentTime + 7 > PrincipiaTime()"-->

This will be true for documents with date within the previous 7 days.



Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937

We must come down from our heights, and leave our straight 
paths, for the byways and low places of life, if we would 
learn truths by strong contrasts; and in hovels, in forecastles, 
and among our own outcasts in foreign lands, see what has been 
wrought upon our fellow-creatures by accident, hardship, or vice. 
- Richard Henry Dana, Jr. 1836