[Zope] Differents of two ZopeTime

Small Business Services toolkit at magma.ca
Tue Mar 23 08:09:03 EST 2004


From: <fowlertrainer at anonym.hu>
> Hello Small,
>
> Tuesday, March 23, 2004, 1:28:18 PM, you wrote:
>
> SBS> From: <fowlertrainer at anonym.hu>
> >>   I want to measure the time of process in Zope.
> >>
> >>   sd=context.ZopeTime()
> >>   ...
> >>   se=context.ZopeTime()
> >>   d=se-sd
> >>   print str(DateTime(str(sd))
> >>   print str(DateTime(str(se))
> >>
> >>   it is working, so it is show the two datetimes.
> >>
> >>   But how to I show the different of the times ?
> >>   print str(DateTime(str(d)) is not working good !

ok... how about: (also untested!)

sd=context.float(ZopeTime())
se=context.float(ZopeTime())
diff = se-sd

diff will then be the difference in time between sd and se, expressed in
seconds (which you can then format as you please).


Jonathan




More information about the Zope mailing list