[Python-checkins] bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200)

ambv webhook-mailer at python.org
Fri Oct 29 16:17:31 EDT 2021


https://github.com/python/cpython/commit/3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0
commit: 3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0
branch: main
author: Ian Fisher <ian at iafisher.com>
committer: ambv <lukasz at langa.pl>
date: 2021-10-29T22:17:22+02:00
summary:

bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200)

files:
M Doc/library/sqlite3.rst

diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index fe1b64ade9561..19a4155542382 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -1095,6 +1095,12 @@ If a timestamp stored in SQLite has a fractional part longer than 6
 numbers, its value will be truncated to microsecond precision by the
 timestamp converter.
 
+.. note::
+
+   The default "timestamp" converter ignores UTC offsets in the database and
+   always returns a naive :class:`datetime.datetime` object. To preserve UTC
+   offsets in timestamps, either leave converters disabled, or register an
+   offset-aware converter with :func:`register_converter`.
 
 .. _sqlite3-controlling-transactions:
 



More information about the Python-checkins mailing list