如何将没有时区的时间戳(例如2016-05-26 13:00:00.000000
)从PostgreSQL的PST
转换为UTC
?
简单地做:$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;