I am having timestamps with time zone in my DB. These are always created in UTC.
I need to display the time to users in Europe/Berlin. Right now I would need to modify the time everywhere with JS or Jinja2 to display to correct time. I feel like there should be a global solution, but I cant find one.
This is an example (models):
class User(UserMixin, Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
date_added = Column(DateTime(timezone=True), nullable=False)
and here is the code if a user is created:
new_user = User(date_added=datetime.today())
This os how it looks like in the DB:
Once I worked with a MySQL DB and I was using this:
db_session.execute("SET SESSION time_zone = 'Europe/Berlin'")
Is there something similar for posgreSQL?