On Thu, 19 Oct 2000, J Kinsley wrote:

> 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)

AFAIK the fmt cannot be used like that

What I usually do is create a DateTime object and then use the 
DateTime's methods and string formatting e.g.

            <dtml-with "_.DateTime(mtime)">
              <dtml-var "'%i-%s-%s' % (year(), mm(), dd())">

Modify the above for your needs. A list of DateTime's methods can
be found in the appendix of the DTML Users Guide


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

Reply via email to