[issue29099] sqlite3 timestamp converter cannot handle timezone

Marc-Andre Lemburg report at bugs.python.org
Wed Jan 11 12:16:25 EST 2017


Marc-Andre Lemburg added the comment:

On 11.01.2017 17:04, Xiang Zhang wrote:
> I am not sure it's worth to make it even optional in 3.7. Discarding tzinfo sounds weird, and worse, the behaviour is not deterministic, it could also fail with an exception.

Best practice is to store all date/time values using UTC (or some
other fixed timezone) in databases and to manage the timezone/locale
information elsewhere.

The TZ info then becomes redundant and only results in more
database space being used as well as slower queries (due to the extra
TZ calculations being done; many databases internally store the
values as UTC to avoid having to do TZ calculations at query time).

Of course, there are use cases, where you'd still want to work
with TZ values in the database, so an extra converter for this
sounds like a good plan.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29099>
_______________________________________


More information about the Python-bugs-list mailing list