[ZCM] [ZC] 222/ 2 Reject "DateTime calculates wrong time differences"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Thu, 14 Feb 2002 11:44:31 -0500


Issue #222 Update (Reject) "DateTime calculates wrong time differences"
 Status Rejected, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/222

==============================================================
= Reject - Entry #2 by ajung on Feb 14, 2002 11:44 am

 Status: Pending => Rejected

The same calculation returns 1.0 on Linux and Windows XP.
The DateTime arithmetic depends on the underlying floating
point machinery of the operating system and the CPU. 

- aj 
________________________________________
= Request - Entry #1 by Anonymous User on Feb 14, 2002 11:28 am

The difference between the dates that are before 2002/03/31 and after 2002/04/01 lead to wrong results.

E.g. the Python Script 

> t1 = context.ZopeTime('2002/03/31')
> t2 = context.ZopeTime('2002/04/01')
> return t2 - t1

returns 0.958333333328 instead of 1.0

This is very critical if your business logic relies on that functionality e.g. for price calculation for rentals.

==============================================================