[egenix-users] DateTimeFromString off by one sec?

Francesco Pierfederici fpierfed at lsst.org
Tue May 6 15:27:53 CEST 2008


I am using mx.DateTime to parse dates and times in ISO format. I have
noticed that DateTimeFromString seems to be off by one second if the
time string being parsed ends with :59

>>> mx.DateTime.Parser.DateTimeFromString('2008-05-06T19:30:09.59')
<mx.DateTime.DateTime object for '2008-05-06 19:30:09.58' at 651a8>


>>> mx.DateTime.Parser.DateTimeFromString('2008-05-06T19:30:09.58')
<mx.DateTime.DateTime object for '2008-05-06 19:30:09.58' at 8c250>

Adding formats=['iso', ] does not change the results. I am using
mx.DateTime 3.0 by the way.

Am I doing something wrong?

Thank you!

More information about the egenix-users mailing list