Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 rails5/postgres。目前,created_at 和 updated_at 是 UTC,我如何使用 SQL 查询将其更新到本地时区,比如澳大利亚悉尼。另外,我想在 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';
update table_name set created_at = created_at + 10 * interval '1 hour';
update table_name set updated_at = updated_at + 10 * interval '1 hour';
发现上面的命令会更新表时间戳。