[Zope] Calculations on a Date Field

Mike Renfro renfro@tntech.edu
Sat, 11 May 2002 18:59:46 -0500


On Fri, May 10, 2002 at 04:36:47PM +0000, complaw@hal-pc.org wrote:

> <dtml-var date_posted>
>
> What I want to do is recalculate the date_posted and shift the time
> back about five hours.

grep through the Squishdot source code and you'll see that date_posted
is a method in Posting.py -- it returns a string, so you can't do any
manipulations with it out of the box. I have a patch on Squishdot's
Sourceforge site
(http://sourceforge.net/tracker/index.php?func=detail&aid=502917&group_id=1083&atid=301083)
that provides user-defined date formats, among other things. I may get
it into a separate CVS branch of Squishdot once I'm done with some
other projects.

If you needed a one-off solution, you could edit Posting.py and change
the date format to whatever you want, or change timezones, etc. If you
don't have filesystem access, this probably isn't an option.

-- 
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- renfro@tntech.edu