Very often in old databases a timestamp column does not have the timezone info. This becomes an issue when the business gets bigger and crosses different timezones.

[code] select bare_timestamp_field at time zone ‘Asia/Shanghai’ at time zone ‘US/Pacific’ from some_table; [/code]

The above sample query assigns the Shanghai timezone to the bare timestamp, then convert the resulting timestamp w/ timezone to the US Pacific PST timestamp.

The double ‘at time zone’ parts can be read as: from timezone #1 to timezone #2. This is due to the implicit syntax. A more explicit syntax is the following, which makes more sense similar to type casting.

[code] select ((bare_timestamp_field at time zone ‘Asia/Shanghai’) at time zone ‘US/Pacific’) from some_table; [/code]

https://popsql.io/learn-sql/postgresql/how-to-convert-utc-to-local-time-zone-in-postgresql/ https://stackoverflow.com/questions/36341060/convert-a-utc-timezone-in-postgresql-to-est-local-time