How to change the Timezone setting for Heroku Postgres?


I want to change the timezone of my Heroku Postgres database.


We highly suggest leaving your database times in UTC and modifying them at your application level. This results in your data being more ubiquitous and easier to convert when needed. Having dates in the database using a different timezone to be problematic since many libraries and functions often expect dates and times in UTC.

If you need to change the timezone, you can do so by connecting to your Heroku Postgres instance with $ heroku pg:psql and running ALTER DATABASE your_database_name SET timezone = timezone_name;. However, please consider the repercussions of changing the timezone for your application.

For example: ALTER DATABASE your_database_name SET timezone = 'Brazil / East';.

You can find the name of the different timezones recognized by PostgreSQL by running SELECT * FROM pg_timezone_names; on your database.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support