[Python-checkins] cpython (2.7): Issue #29123: Make CheckSqlTimestamp more robust

berker.peksag python-checkins at python.org
Sat Dec 31 18:49:23 EST 2016


https://hg.python.org/cpython/rev/1d5b4426fe87
changeset:   105917:1d5b4426fe87
branch:      2.7
parent:      105890:0d20da97a6a0
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Sun Jan 01 02:51:46 2017 +0300
summary:
  Issue #29123: Make CheckSqlTimestamp more robust

files:
  Lib/sqlite3/test/types.py |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py
--- a/Lib/sqlite3/test/types.py
+++ b/Lib/sqlite3/test/types.py
@@ -383,8 +383,7 @@
         if sqlite.sqlite_version_info < (3, 1):
             return
 
-        # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time.
-        now = datetime.datetime.now()
+        now = datetime.datetime.utcnow()
         self.cur.execute("insert into test(ts) values (current_timestamp)")
         self.cur.execute("select ts from test")
         ts = self.cur.fetchone()[0]

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list