The server's timezone is +00:00, web site (running Flask, Heroku) users timezone is "Europe/Kiev" +03:00. I'm using this code to save a date and time to db:
created_at = db.Column(
db.DateTime(timezone=True),
nullable=False,
server_default=db.func.now(),
)
But it saves it like 2022-08-09 11:11:57.831000 +00:00 and the time on fromtend shows the same way.
How to save my local time to DB or how to show time considering my local timezone?
created_atfield in the database? 2) Is the datetime/timestamp starting out as2022-08-09 14:11:57.831?2022-08-09 11:11:57.831000 +00:00datetimeis a Python type. The type in the database field will either betimestampor timestamptz. You need to look at the schema definition for the database table. Using the Postgres command line clientpsql` that can be done with\d <table_name>.