SQL query to update to current timezone

107 Views Asked by At

I am using rails5/postgres. Currently, created_at and updated_at is in UTC, how can I update it to local timezone say Sydney Australia using SQL query. Also, I wanted to run the script in postico.

1

There are 1 best solutions below

0
On

update table_name set created_at = created_at + 10 * interval '1 hour'; update table_name set updated_at = updated_at + 10 * interval '1 hour';

Found the above command will update the table time stamp.