Re: [Zope] Date and Time
Dear Zopistas, is there a subtle trick to using date and time from a folder property or using the fmt="%[A-Za-z]" options? When I use &dtml-var "_[ 'sequence-item'].date" fmt="aCommon"; the date and time shows me the date and time according to the local timezone (Pacific Standard Time) just as I need it. However, when I use &dtml-var "_[ 'sequence-item'].date" fmt="%a %m/%d %x %X %c"; fmt="aCommon" all the dates and times are 7 hours ahead (GMT?). I'm looking at the python module docs (http://www.python.org/doc/current/lib/module-time.html) and wondering why I can't extract the correct information according to the local timezone (as fmt="aCommon" seems to do). Am I doing something wrong or just plain overlooking something? Any Zope Zen hint(s) would be appreciated! Thanks, = Joe = Jim Fulton wrote:
Stephan Richter wrote:
hey guys,
sorry, i have another question: How can I display dates and time smart.
That what I did so far: I wrote an external method that returns a DateTime object. I call it: <!--#var get_current_time fmt=aCommon--> But I want to display everything like I wish using strftime syntax.
You can use strftime formats with date-time objects, as in:
<!--#var get_current_time fmt="%Y/%m/%d"-->
Note that you can use ZopeTime to get the current time:
<!--#var ZopeTime fmt="%Y/%m/%d"-->
I tried to pass a format attribute to the external function, but I could not figure out, how to call this function with an attribute.
If the eternal method accepted keywork arguments, you could then use a similar syntax:
<!--#var "get_current_time(fmt=;%Y/%m/%d')"-->
-- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
participants (1)
-
Joe Grace