-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-45335: Add note to sqlite3
docs about "timestamp" converter
#29200
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1049,6 +1049,17 @@ 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. | ||
|
||
.. warning:: | ||
|
||
The "timestamp" converter ignores UTC offsets in the database and always | ||
returns a naive :class:`datetime.datetime` object, so if you read a timestamp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Outside of tutorials and howtos, we avoid addressing the reader as "you", instead using a style where the "you" is implied. Instead of saying:
simply say:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I'd drop that part of the sentence. The first part already says that UTC offsets are ignored; no need to exemplify it. How about something like this:
|
||
from the database with converters enabled and then write it back, any UTC | ||
offset will be lost. | ||
|
||
If you need to preserve UTC offsets in timestamps, then either leave | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, instead of |
||
converters disabled, or register your own offset-aware converter with | ||
:func:`register_converter` to override the default one. | ||
|
||
|
||
.. _sqlite3-controlling-transactions: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We avoid using warnings in documentation. Instead we describe behavior using affirmative tone.