[egenix-users] Roundoff problem in DateTime
reggie at merfinllc.com
Fri Jul 5 16:19:17 CEST 2002
I'm using what I believe to be the latest version of mx.DateTime (2.0.3)
and I seem to have discovered a roundoff problem. The problem occurs on
Redhat 7.1, but not under Windows 2000 SP2. Both are running the same
versions of python and mx.DateTime.
After performing a floating point addition, I'm getting a time of
24:00:00 instead of getting 00:00:00 for the next day. The release
notes mention a similar problem and seem to indicate that it has already
been addressed. I'm able to consistently reproduce this my problem with
the simple example below.
So, I was wondering if anyone else has this problem or if there is a
patch/known workaround for it.
Thanks in advance,
$ uname -a
Linux auk 2.4.9-34 #1 Sat Jun 1 06:10:23 EDT 2002 i686 unknown
Python 2.2.1 (#1, Apr 29 2002, 15:21:53)
[GCC 3.0.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mx.DateTime
>>> t = mx.DateTime.DateTimeFromAbsDateTime(730488, 81317.647058823524)
<DateTime object for '2001-01-03 22:35:17.64' at 8134e20>
>>> t + 1.0/17.0
<DateTime object for '2001-01-03 24:00:00.00' at 8166700>
More information about the egenix-users