]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #29123: Make CheckSqlTimestamp more robust
authorBerker Peksag <berker.peksag@gmail.com>
Sat, 31 Dec 2016 19:48:55 +0000 (22:48 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Sat, 31 Dec 2016 19:48:55 +0000 (22:48 +0300)
Lib/sqlite3/test/types.py

index 0b5b3e7e3c2e5ed6bf85a424ea150110657aceb0..6bc8d71def0e31bf1e266578ad6126b96df8f5de 100644 (file)
@@ -382,8 +382,7 @@ class DateTimeTests(unittest.TestCase):
     @unittest.skipIf(sqlite.sqlite_version_info < (3, 1),
                      'the date functions are available on 3.1 or later')
     def CheckSqlTimestamp(self):
-        # 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]