[devtools] stop using datetime.now() in cwctl newcube and i18ncube
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 09 Dec 2015 14:20:30 +0100
changeset 10963 9b1c7f337eb3
parent 10962 625b951b4a1a
child 10964 bf381a894cd3
[devtools] stop using datetime.now() in cwctl newcube and i18ncube
devtools/devctl.py
--- a/devtools/devctl.py	Wed Dec 09 14:06:43 2015 +0100
+++ b/devtools/devctl.py	Wed Dec 09 14:20:30 2015 +0100
@@ -26,7 +26,7 @@
 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
 # completion). So import locally in command helpers.
 import sys
-from datetime import datetime
+from datetime import datetime, date
 from os import mkdir, chdir, path as osp
 from warnings import warn
 
@@ -128,7 +128,7 @@
     from cubicweb.i18n import add_msg
     from cubicweb.schema import NO_I18NCONTEXT, CONSTRAINTS
     w('# schema pot file, generated on %s\n'
-      % datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
+      % datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'))
     w('# \n')
     w('# singular and plural forms for each entity type\n')
     w('\n')
@@ -660,7 +660,7 @@
                    'longdesc' : longdesc or shortdesc,
                    'dependencies' : dependencies,
                    'version'  : cubicwebversion,
-                   'year'  : str(datetime.now().year),
+                   'year'  : str(date.today().year),
                    'author': self['author'],
                    'author-email': self['author-email'],
                    'author-web-site': self['author-web-site'],