New submission from Ian Fisher <i...@iafisher.com>:

The SQLite converter that the sqlite3 library automatically registers for 
TIMESTAMP columns 
(https://github.com/python/cpython/blob/main/Lib/sqlite3/dbapi2.py#L66) ignores 
the time zone even if it is present and always returns a naive datetime object.

I think that the converter should return an aware object if the time zone is 
present in the database. As it is, round trips of TIMESTAMP values from the 
database to Python and back might erase the original time zone info.

Now that datetime.datetime.fromisoformat is in Python 3.7, this should be easy 
to implement.

----------
components: Library (Lib)
messages: 402979
nosy: iafisher
priority: normal
severity: normal
status: open
title: Default TIMESTAMP converter in sqlite3 ignores time zone
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45335>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to