(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 a.. The URL may be incorrect. b.. The parameters passed to this resource may be incorrect. c.. 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 a.. The URL may be incorrect. b.. The parameters passed to this resource may be incorrect. c.. 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
Hello, Unless I don't fully understand your problem, bobobase_modification_time is what you want to play with... Here's some DTML I use on my site to display the formatted "last modified" date for my objects. It is in a DTML method called "LastModified" and is at the root level of my Zope tree. It can therefore be called from any object in the hierarchy and will display the Last Modified date of that object: -----8<-- Start Snip --8<----- <dtml-comment> This will display the last modified date of whatever page it is referenced in </dtml-comment> <dtml-with expr="this"><dtml-var bobobase_modification_time fmt="Month"> <dtml-var bobobase_modification_time fmt=day>, <dtml-var bobobase_modification_time fmt="%Y"></dtml-with> -----8<-- End Snip --8<----- To use the method above, I insert the following into a DTML method: <dtml-var LastModified> and it will display something like: Last modified on February 14, 2001 Hope that gets you pointed in the right direction. Eric. -----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
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 )
participants (3)
-
Angietel -
Arno Gross -
Eric Walstad