[egenix-users] Roundoff problem in DateTime
M.-A. Lemburg
mal at lemburg.com
Mon Jul 8 11:33:24 CEST 2002
Reggie Dugard wrote:
> 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.
Could you check whether the problem still persists with the
latest egenix-mx-base beta 2 ? (see the mailing list archives
for all the URLs)
> Reggie Dugard
> Merfin, LLC
>
> $ uname -a
> Linux auk 2.4.9-34 #1 Sat Jun 1 06:10:23 EDT 2002 i686 unknown
> $ python
> 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
>>>>mx.DateTime.__version__
>>>
> '2.0.3'
>
>>>>t = mx.DateTime.DateTimeFromAbsDateTime(730488, 81317.647058823524)
>>>>t
>>>
> <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>
Could you provide a printout of the values of all attributes
this instance has (both on Windows and Linux) ?
t = ...
for attr in t.__members__:
print attr, ':', getattr(t, attr)
Thanks,
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
More information about the egenix-users
mailing list