]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 29 Oct 2021 20:42:38 +0000 (13:42 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Oct 2021 20:42:38 +0000 (22:42 +0200)
(cherry picked from commit 3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0)

Co-authored-by: Ian Fisher <ian@iafisher.com>
Doc/library/sqlite3.rst

index b9436daaebb4b4ea118a7a6f073a4acd081ec33f..b24a2f0985489124285480c5fe27b53efe085af6 100644 (file)
@@ -1062,6 +1062,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: