If you notice that there is an error in the PostgreSQL time when you make time-dependent queries in PostgreSQL, you can change it by following these steps. If you want to change Timezone on Linux you can use my article called “How To Change TimeZone on Centos 7“.
If you want to learn the time in PostgreSQL you can use the following function.
1 2 | Select now(); 2018-12-12 09:44:00.727759-05 |
You can see the timezones from the following query and continue by selecting the timezone you want.
1 | select * from pg_timezone_names ; |
You can change the timezone as follows.
1 | set TIMEZONE='Turkey'; |
After changing the timezone, let’s check the time again with the command below.
1 | Select now(); |