Commit f3c8d796 authored by Guido van Rossum's avatar Guido van Rossum

Fix an odd error which would only occur close to new year's eve, due

to use of datetime.datetime.now() instead of utcnow() for comparison.
(I think the test can still fail if it's executed pretty much *at*
new year's eve, but that's not worth fixing.)
parent 8f17f74b
......@@ -331,8 +331,7 @@ class DateTimeTests(unittest.TestCase):
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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment