Skip to content

Commit b47913f

Browse files
committed
Issue python#29123: Make CheckSqlTimestamp more robust
1 parent b46ea90 commit b47913f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/sqlite3/test/types.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ def CheckSqliteTimestamp(self):
382382
@unittest.skipIf(sqlite.sqlite_version_info < (3, 1),
383383
'the date functions are available on 3.1 or later')
384384
def CheckSqlTimestamp(self):
385-
# SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time.
386-
now = datetime.datetime.now()
385+
now = datetime.datetime.utcnow()
387386
self.cur.execute("insert into test(ts) values (current_timestamp)")
388387
self.cur.execute("select ts from test")
389388
ts = self.cur.fetchone()[0]

0 commit comments

Comments
 (0)