1

I am trying to change the RDS timezone to UTC,
I'm using an SQL Client called DBeaver

I tried the following two commands -

1. Configuration Parameter Name -

SET timezone TO 'UTC';

and

2. Standard SQL Command -

SET TIME ZONE 'UTC';

But the select now(); command still doesn't return the UTC time

I am referring this answer -
postgres default timezone

Tried the following -
enter image description here

echo $PGTZ

enter image description here

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Dev1ce
  • 5,390
  • 17
  • 90
  • 150

2 Answers2

4
SET TIME ZONE 'UTC';
ALTER DATABASE your_db_name SET timezone TO 'UTC';
Forgery
  • 88
  • 6
2

Maybe you are using a connection pool, and session settings get cleared when the session returns to the pool.

You could try something like

ALTER ROLE your_user SET timezone = 'UTC';

You must reconnect for this to take effect.

Also, check if the environment variable PGTZ is set in your environment. It will override the database settings.

If all that doesn't do the trick, consider the possibility that the server's time is off.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263