[Zope3-dev] Can we remove ZopeLegacy for now?

Tim Peters tim@zope.com
Thu, 14 Mar 2002 01:12:42 -0500


[Nicola Larosa]
> Great. So the time has come to dust off my patch to Zope's DateTime.py
> (attached), to go from four-digit to six-digit precision.
>
> Unfortunately, it gives problems with PostgreSQL dates. :^((

Sorry, but it won't do what you expect if applied against Zope's current
(CVS) DateTime.py either.  A number of standard tests failed depending on
the exact time you ran them.  I dug into that.  As a result, I had to fiddle
DateTime.py to (a) make its ._second and ._millis members agree with each
other exactly (previously "redundant" information that in fact could get out
of synch); and, (b) since ._millis can only represent milliseconds, ._second
was cut back to match.

As a result, the tests no longer fail 0.05% - 2% of the time (depending on
the specific test), but also DateTime objects are always rounded to the
closest millisecond now.  A consequence of the latter is that your new code
will never trigger.  OTOH, you can roundtrip convert DateTime -> string ->
DateTime reliably now, and reconstruct a DateTime object exactly from its
components (neither were always true before).