You are not logged in Log in Join
You are here: Home » Members » zwork » Zwork's Tracker » Zwork's Tracker » collector_issue_contents

Log in
Name

Password

 
 
Issue 4 of Zwork's Tracker []
Title: Zwork's Tracker
Status: New Security related: No
Description: A suggestion: ZODBC and/or ZSQL seem to have forgotton about Date fields. I use the following DTML Method (arbitrarily named sqldate)to convert dates...
From: neilx on: Oct 21, 01 07:23
neilx Last update: Oct 21, 01 07:23
Topic/class: /feature request Importance: low
Version info:
Issue 4 Transcript
1 entry
= Request - Entry #1 by neilx on Oct 28, 2001 7:01 am

A suggestion:

ZODBC and/or ZSQL seem to have forgotton about Date fields. I use the following DTML Method (arbitrarily named sqldate)to convert dates in the REQUEST object to SQL date format:

<dtml-if theDate>
<dtml-var expr="_.DateTime(theDate).strftime('#%m/%d/%Y %H:%M:%S#')">
<dtml-else>
<dtml-var expr="_.DateTime().strftime('#%m/%d/%Y %H:%M:%S#')">
</dtml-if>

Then in the SQL Method I use:

<dtml-var expr="sqldate(aDate)" type=nb>

I am sure there are better ways, but it works for me. Is it useful to incorporate into Znolk somehow?

--Neil