Hey all, How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported. Thanks, Ivan Raikov
Hey all,
How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported.
<dtml-var ZopeTime fmt="%Y-%B-%d-%H:%M:%S"> or (preferably as a DateTime.DateTime object) <dtml-call "REQUEST.set('dateTimeObj',ZopeTime())"> PM
At 12:14 PM 6/6/00 -0400, Ivan Raikov wrote:
Hey all,
How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported.
<dtml-var ZopeTime> Maybe a lower case 't'. Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Web2k - Web Design/Development & Technical Project Management
Ivan Raikov wrote:
How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported.
It is in _.DateTime. Plus, ZopeTime() should return the current time and date: <dtml-var ZopeTime> -- Itamar S.T. itamar@maxnm.com "It don't get thingier than that!"
Ivan Raikov writes:
Hey all,
How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported.
<dtml-var ZopeTime>
Thanks, Ivan Raikov
_______________________________________________ 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 )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 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.
On Tue, 06 Jun 2000, you wrote:
Hey all,
How can I get the current date & time (preferably as a DateTime.DateTime object) in DTML? I cannot instantiate a DateTime object, because the DateTime module is not imported.
Thanks, Ivan Raikov
I saved this answer, because I thought I might need it -- might be what you need: ================================================================== From: "Eric L. Walstad" <ewalstad@energywright.com>To: jeffr@odeon.net Cc: zope@zope.org I think I've got the syntax, Jeff: <dtml-var "_.DateTime(birthday)" fmt=aCommon> - birthday is a field returned from my Z SQL Method - The "_.DateTime(birthday)" part creates a DateTime object - The '_' is a reference to the DTML namespace - The DateTime() function creates the DateTime object - The fmt=aCommon part formats it to look like: "May 7, 1966 12:00 am" You can change the format by changing the fmt=XXXX so that XXXX is the format you want from Appdx A of the Zope DTML reference. Eric. =============================================================== If the you the current time, you might also try using ZopeTime instead of "_.DateTime(birthday)". have fun! Luis.
participants (7)
-
Chris Withers -
Itamar Shtull-Trauring -
Ivan Raikov -
Jason Spisak -
Luis Cortes -
Marcel Preda -
Stephan Richter