hooks/metadata.py
changeset 11033 63d860a14a17
parent 10549 5fc21bf2684f
child 11034 75d752e6daf7
--- a/hooks/metadata.py	Fri Dec 18 09:37:15 2015 +0100
+++ b/hooks/metadata.py	Fri Dec 18 09:23:23 2015 +0100
@@ -41,7 +41,7 @@
     events = ('before_add_entity',)
 
     def __call__(self):
-        timestamp = datetime.now()
+        timestamp = datetime.utcnow()
         edited = self.entity.cw_edited
         if not edited.get('creation_date'):
             edited['creation_date'] = timestamp
@@ -64,7 +64,7 @@
         # XXX to be really clean, we should turn off modification_date update
         # explicitly on each command where we do not want that behaviour.
         if not self._cw.vreg.config.repairing:
-            self.entity.cw_edited.setdefault('modification_date', datetime.now())
+            self.entity.cw_edited.setdefault('modification_date', datetime.utcnow())
 
 
 class SetCreatorOp(hook.DataOperationMixIn, hook.Operation):