DateTime in Plone 3

by Matt Sital-Singh on Mar 26, 2009
Filed Under:

Back in the days of Plone 2.x, page templates used to be able to just access Zope's DateTime module like this:

<b tal:content="DateTime()" />

This would give you the current date and time.

In Plone 3.x, this ability disappeared. Now, I'm confident that people wiser than I made this decision, but sometimes I want it back. Imagine my delight when, whilst perusing Plone's advanced search form, I found this little beauty:

<form tal:define="DateTime python:modules['DateTime'].DateTime">
...
</form>

Ker-ching.

Filed under: , ,
Douglas Soares de Andrade
Douglas Soares de Andrade says:
Mar 26, 2009 03:55 PM

Hi,

Thanks a lot !!!!!!! Great to know about that modules dict =)

Alec Mitchell
Alec Mitchell says:
Mar 27, 2009 08:33 PM

You can also try "context/ZopeTime" which is what I became used to doing in pre-Plone days.

Commenting has now closed on this post.

Follow us

— via Twitter

Is proudly sponsoring #BlueLightCamp today. If you want to come talk Open Source content management @HammerToe is there #blcamp
last month