SQLAlchemy DateTime timezone

前端 未结 4 1039
情话喂你
情话喂你 2021-01-31 07:54

SQLAlchemy\'s DateTime type allows for a timezone=True argument to save a non-naive datetime object to the database, and to return it as such. Is there

4条回答
  •  庸人自扰
    2021-01-31 08:29

    http://www.postgresql.org/docs/8.3/interactive/datatype-datetime.html#DATATYPE-TIMEZONES

    All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the timezone configuration parameter before being displayed to the client.

    The only way to store it with postgresql is to store it separately.

提交回复
热议问题