asyncpg
asyncpg copied to clipboard
Use UTC for `timestamp without time zone`
asyncpg
converts timestamps to datetime.datetime
. If a column has type timestamp without time zone
then the datetime object's .tzinfo
is None
. This means datetime
implicitly treats this datetime as if it is local, and source code has to replace tzinfo for every column that has timestamp without time zone
.
I'd expect that when developers specify no timezone it is intended to be UTC, otherwise timezone would be specified in the postgres datatype?
With this in mind it makes sense to provide UTC timezone type when creating datetime.datetime
objects from columns that do not specify timezone (at least IMO).