[Zope] - strftime for DateTime
skip@calendar.com (Skip Montanaro)
skip@calendar.com (Skip Montanaro)
Wed, 6 Jan 1999 22:09:36 -0500 (EST)
Simon> I'm going to be incredibly dumb now and ask if this can now be
Simon> accessed through DTML and how.
If you apply the patch I posted to the DateTime.py file in the
lib/python/DateTime package, yes, you should be able to. As for using it,
suppose you call a document template with a DateTime object named start. As
Jim pointed out, you could then execute
>>> import DocumentTemplate, DateTime, time
>>> t = DocumentTemplate.HTML('<!--#var start fmt="%Y/%m/%d"-->')
>>> start = DateTime.DateTime(time.time())
>>> t(start=start)
'1999/01/07'
You will generally have more complex examples than this, but this should
serve to demonstrate the capability.
Simon> I'm a perl/CGI veteran looking for a way not to reinvent the
Simon> wheel for a reasonably idiot proof semi-public music/artist
Simon> presentation service and if I get my head around it, Zope is the
Simon> one. A recipe book for the basic functions would be a great help
Simon> though, and I'll pitch my hand in for anything I can help with)
There are tutorials floating around the Zope web site. I'm only using the Z
Publisher and DTML pieces at this point, because I don't need all the
document and user management stuff that Zope shines at.
Also, note my .sig. Perhaps we have something non-Zopish to discuss
off-line...
Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/
skip@calendar.com | Musi-Cal: http://concerts.calendar.com/
518-372-5583