Since it was installed in the United States of PostgreSQL, resulting in the return to Shanghai after use, found that the time data display is incorrect.
To acomplish the timezone change in Postgres 9.6 you must:
(1) View current timezone:
Show TimeZone;
Or check it out on Pgadmin 4:
The time zone is a session parameter. So, you can change the timezone for the current session.
set timezone TO ‘
Asia/Shanghai
‘;
Note: ' Set timezone to: ' Only sets the timezone for the current session and if your change the timezone configuration parameter In postgresql.conf it should a change of the timezone for all databases.
Choose a timezone from:
SELECT * FROM pg_timezone_names;
Search for the closest your zone and set example:
ALTER DATABASE postgres SET timezone TO ‘Asia/Shanghai‘;
Use your DB name.
(2) Uncomment the "timezone" line in your postgresql.conf
file and put your timezone as shown:
(3) Restart Postgres or Tools>reload Configuration (then refresh)
Reference: Https://stackoverflow.com/questions/6663765/postgres-default-timezone
The use of PostgreSQL