[egenix-users] DateTime error rounding seconds

Edwin Grubbs egrubbs at rackspace.com
Fri Mar 29 20:24:23 CET 2002


I am having a problem with DateTime incorrectly rounding the floating 
point second value down 1/100 of second.

Python 2.2 (#1, Mar 13 2002, 12:34:11) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mx.DateTime import *
>>> DateTime(2002, 1, 2, 3, 4, 5.00)
<DateTime object for '2002-01-02 03:04:05.00' at 8126658>
>>> DateTime(2002, 1, 2, 3, 4, 5.01)
<DateTime object for '2002-01-02 03:04:05.00' at 8152098>
>>> DateTime(2002, 1, 2, 3, 4, 5.02)
<DateTime object for '2002-01-02 03:04:05.01' at 8126658>
>>> DateTime(2002, 1, 2, 3, 4, 5.03)
<DateTime object for '2002-01-02 03:04:05.03' at 8152098>
>>> DateTime(2002, 1, 2, 3, 4, 5.04)
<DateTime object for '2002-01-02 03:04:05.04' at 8126658>
>>> DateTime(2002, 1, 2, 3, 4, 5.05)
<DateTime object for '2002-01-02 03:04:05.04' at 8152098>
>>> DateTime(2002, 1, 2, 3, 4, 5.06)
<DateTime object for '2002-01-02 03:04:05.05' at 8126658>


-Edwin Grubbs




More information about the egenix-users mailing list