[Zope3-dev] Changing DC timeannotators to use UTC timezone

Gary Poster gary at zope.com
Wed Jul 13 15:04:57 EDT 2005


As we agreed on this list many months ago, I'd like to change the  
zope code to use the UTC timezone explicitly, rather than utcnow  
(datetime.datetime.utcnow() -> datetime.datetime.now(pytz.utc).  I  
only plan to change this in one place: zope/app/dublincore/ 
timeannotators.py.

The reason I bring this up here (again) is that the change will  
introduce a potential problem with legacy databases.  If there are  
comparisons of creation or modification dates--as an index of these  
values would make, for instance--then the comparison of the old naive  
and the new aware datetimes will cause creation and modification of  
indexed objects to fail.

A migration path that is good enough for the catalog use case is to  
walk over all of the objects in the intid utility, convert the  
datetimes for creation and modification, and finally reindex your  
catalogs.  That's probably all we (ZC) need, for instance.

May I proceed?

Gary


More information about the Zope3-dev mailing list