[egenix-users] mxDateTime calculation error

Jäckle Thomas tjaeckle at zes.com
Mon Jan 3 16:20:12 CET 2005


Hello !

Thanks for the fast answer.
I tried with versions 2.0.5 and 2.0.6 on Win95 and WinXP. All four
combinations have produced the same (fail) result!

Best regards


> -----Original Message-----
> From: M.-A. Lemburg [mailto:mal at egenix.com]
> Sent: Monday, January 03, 2005 2:47 PM
> To: tjaeckle at zes.com
> Cc: egenix-users at lists.egenix.com
> Subject: Re: [egenix-users] mxDateTime calculation error
>
>
> Jäckle Thomas wrote:
> > Hello!
> >
> > I found an error when executing following Python script:
> >
> > import mx.DateTime
> > date = mx.DateTime.DateTime(2005, 1, 2, 12, 42, 27.64)
> > print date
> > date = date - 0
> > print date
> >
> > The result should be:
> > 2005-01-02 12:42:27.64
> > 2005-01-02 12:42:27.63
> >
> > So the subtraction of 0 seems to change the time! This
> reduction of 1/100
> > second happens not always but only with several numbers (like 27.64s in
> > above example).
> > This subtraction happens for example at the end of the DateTimeFrom()
> > function (where on offset of 0 is subtracted), so I can't work
> around it.
> >
> > Is this bug known? Is there any solution?
>
> This sounds like a bug on the platform you are using or
> with the compiler.
>
> Which version of egenix-mx-base are you using ? Testing with
> the latest snapshot of egenix-mx-base, I don't get this output:
>
>  >>> import mx.DateTime
>  >>> date = mx.DateTime.DateTime(2005, 1, 2, 12, 42, 27.64)
>  >>> print date
> 2005-01-02 12:42:27.64
>  >>> print date + 0
> 2005-01-02 12:42:27.64
>  >>> print date - 0
> 2005-01-02 12:42:27.64
>
> --
> Marc-Andre Lemburg
> eGenix.com
>
> Professional Python Services directly from the Source  (#1, Jan 03 2005)
>  >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>  >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>  >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
> ________________________________________________________________________
> 2004-12-06: Released eGenix mx Extensions for Python 2.4
>
> ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
>
>



More information about the egenix-users mailing list