ZPT: getting the current year
i am sure this is easy as hell, but as much as i tried, i did not yet arrive. please spare me the agony of listing all the things i tried, could someone just please give me a tal:define statement that stores the current year in four digit form into a variable for use in a ZPT? thanks, -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! if one cannot enjoy reading a book over and over again, there is no use in reading it at all. -- oscar wilde
On Wed, Aug 20, 2003 at 03:38:09PM +0200, martin f krafft wrote:
i am sure this is easy as hell, but as much as i tried, i did not yet arrive. please spare me the agony of listing all the things i tried, could someone just please give me a tal:define statement that stores the current year in four digit form into a variable for use in a ZPT?
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixB.stx (search for DateTime) example: <span tal:define="year python:DateTime().year()"> </span> -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's TOMATO CONDOM! (random hero from isometric.spaceninja.com)
<span tal:define="yyyy python:here.ZopeTime().strftime("%Y")">...</span> - Babu http://vsbabu.org/ martin f krafft wrote:
i am sure this is easy as hell, but as much as i tried, i did not yet arrive. please spare me the agony of listing all the things i tried, could someone just please give me a tal:define statement that stores the current year in four digit form into a variable for use in a ZPT?
thanks,
also sprach Satheesh Babu <vattekkat.babu@verizon.net> [2003.08.23.1310 +0200]:
<span tal:define="yyyy python:here.ZopeTime().strftime("%Y")">...</span>
except for the quotes, this works fine! thanks, -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck keyserver problems? http://keyserver.kjsl.com/~jharris/keyserver.html get my key here: http://madduck.net/me/gpg/publickey riesco a leggerti i pensieri. dovresti vergognarti.
martin f krafft wrote:
i am sure this is easy as hell, but as much as i tried, i did not yet arrive. please spare me the agony of listing all the things i tried, could someone just please give me a tal:define statement that stores the current year in four digit form into a variable for use in a ZPT?
untested: <tal:block tal:define="global current_year python:here.ZopeTime().strftime('%Y')"> </tal:block> regards Max M
participants (4)
-
martin f krafft -
Max M -
Paul Winkler -
Satheesh Babu