[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/dublincore/timeannotators.py
Convert to using explicit timezones for the dublincore attributes.
Gary Poster
gary at zope.com
Wed Jul 13 16:50:29 EDT 2005
Log message for revision 33301:
Convert to using explicit timezones for the dublincore attributes.
Changed:
U Zope3/trunk/src/zope/app/dublincore/timeannotators.py
-=-
Modified: Zope3/trunk/src/zope/app/dublincore/timeannotators.py
===================================================================
--- Zope3/trunk/src/zope/app/dublincore/timeannotators.py 2005-07-13 18:50:34 UTC (rev 33300)
+++ Zope3/trunk/src/zope/app/dublincore/timeannotators.py 2005-07-13 20:50:28 UTC (rev 33301)
@@ -18,6 +18,7 @@
__docformat__ = 'restructuredtext'
from datetime import datetime
+import pytz
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.security.proxy import removeSecurityProxy
@@ -28,7 +29,7 @@
# Principals that can modify objects do not necessary have permissions
# to arbitrarily modify DC data, see issue 373
dc = removeSecurityProxy(dc)
- dc.modified = datetime.utcnow()
+ dc.modified = datetime.now(pytz.utc)
def CreatedAnnotator(event):
@@ -37,6 +38,6 @@
# Principals that can create objects do not necessary have permissions
# to arbitrarily modify DC data, see issue 373
dc = removeSecurityProxy(dc)
- now = datetime.utcnow()
+ now = datetime.now(pytz.utc)
dc.created = now
dc.modified = now
More information about the Zope3-Checkins
mailing list