[Python-checkins] r59637 - python/trunk/Lib/sqlite3/test/types.py

guido.van.rossum python-checkins at python.org
Tue Jan 1 05:15:30 CET 2008


Author: guido.van.rossum
Date: Tue Jan  1 05:15:29 2008
New Revision: 59637

Modified:
   python/trunk/Lib/sqlite3/test/types.py
Log:
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.)


Modified: python/trunk/Lib/sqlite3/test/types.py
==============================================================================
--- python/trunk/Lib/sqlite3/test/types.py	(original)
+++ python/trunk/Lib/sqlite3/test/types.py	Tue Jan  1 05:15:29 2008
@@ -331,8 +331,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]


More information about the Python-checkins mailing list