absent1706 / sqlalchemy-mixins

Active Record, Django-like queries, nested eager load and beauty __repr__ for SQLAlchemy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does the TimestampsMixin not enable timezones?

jonbiemond opened this issue · comments

I'm curious as to why the TimestampsMixin explicitly disable timezones in the TIMESTAMP fields.

sa.TIMESTAMP(timezone=False),

Looking at the relevant commit message it seems like @metheoryt meant to enable them.

Is there any reason to have timezones disabled on those fields?

commented

Hi @jonbiemond !
As I remember, it didn’t seem useful to me to have a timezone at those columns at that moment.
Since the columns aren’t meant to be updated by end users, there is no point to store a timezone here.
If you need to display that data in a timezone-aware approach, it is better to convert it to desired timezone at displaying time.

However, it is a general rule and might not apply for your case. If you need timezone aware timestamps for those fields, I could suggest you to add them manually.

Hello!

Yes, that makes perfect sense. Thank you! I appreciate the suggestion.