From b47913f54f7b09189f0695144b26e85d87227d3d Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 31 Dec 2016 22:48:55 +0300 Subject: [PATCH] Issue #29123: Make CheckSqlTimestamp more robust --- Lib/sqlite3/test/types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py index 0b5b3e7e3c2..6bc8d71def0 100644 --- a/Lib/sqlite3/test/types.py +++ b/Lib/sqlite3/test/types.py @@ -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]