[Zope] How to customize my date?

Arno Gross arno.gross@consotec.de
Thu, 15 Feb 2001 07:18:37 -0100


Is 'lastmodify' coming from a RDBMS? If so,
you can/should customize your date format in your
SELECT statement. Or you can try to use the
DateTime modul and pass your 'lastmodify' and
then you can use the fmt attribute.
Try this:
<dtml-var "_.DateTime(lastmodify)" fmt="%d.%m.%y">  

Arno Gross, email: arno.gross@consotec.de




> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Angietel
> Sent: Wednesday, February 14, 2001 6:05 PM
> To: zope@zope.org
> Subject: [Zope] (correct)How to customize my date?
> 
> 
> For my 'lastmodify' datatype is TIMESTAMP(14)
> 
> In my search result screen i tried to put the <dtml-var> attribute like
> this:-
> <dtml-var lastmodify fmt="%d-%m-%y %H:%M">
> 
>  but it return this result:-
> Zope Error
> Zope has encountered an error while publishing this resource.
> Error Type: TypeError
> Error Value: illegal argument type for built-in operation
> 
> 
> 
> 
> Troubleshooting Suggestions
> The URL may be incorrect.
> The parameters passed to this resource may be incorrect.
> A resource that this resource relies on may be encountering an error.
> For more detailed information about the error, please refer to the HTML
> source for this page.
> If the error persists please contact the site maintainer. Thank you for your
> patience.
> 
> And i tried to use the namespace like this
> <dtml-call REQUEST.set('_.['lastmodify']','b')>
> 
> <dtml-var b fmt="%d-%m-%y %H:%M">
> 
> it return the attribute error:
> Zope Error
> Zope has encountered an error while publishing this resource.
> Error Type: TypeError
> Error Value: illegal argument type for built-in operation
> 
> 
> 
> 
> Troubleshooting Suggestions
> The URL may be incorrect.
> The parameters passed to this resource may be incorrect.
> A resource that this resource relies on may be encountering an error.
> For more detailed information about the error, please refer to the HTML
> source for this page.
> If the error persists please contact the site maintainer. Thank you for your
> patience.
> 
> Can u tell me how to display my date as :
> 2001-02-08 04:41 PM
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )