Postgres: Pass timezone into image

Created on 22 Mar 2016  路  3Comments  路  Source: docker-library/postgres

Is there a way to pass the timezone into Postgres. ?
I would like for the dates to be GMT+1

Most helpful comment

I can confirm that passing -e TZ=Europe/Amsterdam sets the default timezone to Europe/Amsterdam.

Keep in mind that the value should be a full time zone name. See: https://www.postgresql.org/docs/9.5/static/datatype-datetime.html#DATATYPE-TIMEZONES

All 3 comments

The PostgreSQL docs describe two environment variables related to this.
initdbuses TZ as the value it writes to postgres.conf
libpq checks for PGTZ to determine which time zone to set (for the client) after connecting (to the server)

I suspect setting these in the usual fashion will work but haven't tried it.

I can confirm that passing -e TZ=Europe/Amsterdam sets the default timezone to Europe/Amsterdam.

Keep in mind that the value should be a full time zone name. See: https://www.postgresql.org/docs/9.5/static/datatype-datetime.html#DATATYPE-TIMEZONES

Closing old issue. Looks like this was resolved.

Was this page helpful?
0 / 5 - 0 ratings