From ef4f47f5d9d9ae6c88e2be18141b64e22f89de81 Mon Sep 17 00:00:00 2001 From: Ian Fisher Date: Fri, 29 Oct 2021 16:17:22 -0400 Subject: [PATCH] bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200) (cherry picked from commit 3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0) Co-authored-by: Ian Fisher --- Doc/library/sqlite3.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index b9436daaebb4b4..b24a2f09854891 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -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: