I have a column with different timezone data. I need to convert every row to pst.
----------------------
| COLUMN |
----------------------
|01/17/2024 18:00 PST|
|01/16/2024 18:00 CST|
|01/18/2024 12:00 IST|
|01/18/2024 07:00 -05|
|01/16/2024 14:00 -05|
|01/17/2024 18:00 IST|
|01/18/2024 17:00 IST|
|01/17/2024 16:00 GMT|
|01/18/2024 14:00 EST|
|01/17/2024 16:00 -05|
----------------------
You can use the AT TIME ZONE clause to convert them:
select
to_timestamp_tz ( '01/17/2024 18:00 PST', 'MM/DD/YYYY HH24:MI TZR' ) at time zone 'CET',
to_timestamp_tz ( '01/17/2024 16:00 GMT', 'MM/DD/YYYY HH24:MI TZD' ) at time zone 'CET'
from dual;
TO_TIMESTAMP_TZ('01/17/202418:00P TO_TIMESTAMP_TZ('01/17/202416:00G
--------------------------------- ---------------------------------
18/01/2024 03:00:00.000000000 CET 17/01/2024 17:00:00.000000000 CET
Ensure that the values are TIMESTAMP WITH TIME ZONEs or you'll get implicit conversions which may lead to unexpected results.