标签: sql postgresql timezone timestamp-with-timezone
如何在PostgreSQL中将没有时区的时间戳(例如2016-05-26 13:00:00.000000)从说明PST转换为UTC?
2016-05-26 13:00:00.000000
PST
UTC
答案 0 :(得分:1)
只需:$input::TIMESTAMP AT TIME ZONE $src AT TIME ZONE $dest例如:
$input::TIMESTAMP AT TIME ZONE $src AT TIME ZONE $dest
SELECT event_timestamp::TIMESTAMP AT TIME ZONE 'America/New_York' AT TIME ZONE 'UTC' FROM events;