I am probably missing something simple here, however I can not get
this to work properly....

Given mtime = YYYY-MM-DD HH:MM:SS-ZZ as returned from PostgreSQL, how
do I get the following to work without errors?  

<dtml-in "sqlquery(...)">
 <dtml-var mtime fmt="%a %d %b %Y %H:%M:S %Z">
</dtml-in query>

This returns:
Errot Type:  ValueError
Error Value: unsupported format character 'a' (0x61)

If i drop the %a from the fmt string as follows:

<dtml-in "sqlquery(...)">
 <dtml-var mtime fmt="%d %b %Y %H:%M:S %Z">
</dtml-in query>

I get the following Zope Error:
Error Type:  Type Error
Error Value: illegal argument type for built-in operation

Mtime was initially declared as a string in the ZSQL Method arguments
list, and changing it to date had no effect.  I have searched the
documentation and all examples I have found that use strftime
formatting indicate that this should work.  I have successfully been
able to change the format using the to_char(mtime) PostgreSQL
function, but then order by mtime does not work properly and besides,
I would like to make the format style customizable from within Zope
instead of on the SQL server.

Thanks in advance for any suggestions....

Jarrod Kinsley

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to