简体   繁体   中英

SQL query to update to current timezone

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM