Search notes:
Oracle: ALTER SESSION SET TIME_ZONE …
select
sessiontimezone
from
dual;
--
-- SESSIONTIMEZONE
-- ---------------------------------------------------------------------------
-- Europe/Berlin
Modify the session's time zone:
alter session set time_zone ='America/New_York';
--
-- Session altered.
select
sessiontimezone
from
dual;
--
-- SESSIONTIMEZONE
-- ---------------------------------------------------------------------------
-- America/New_York
Modify relative to GMT:
alter session set time_zone = '-03:00';
select
sessiontimezone
from
dual;
--
-- SESSIONTIMEZONE
-- ---------------------------------------------------------------------------
-- -03:00
select
to_char(systimestamp , 'yyyy-mm-dd hh24:mi:ss (tzr)') ts1,
to_char(systimestamp at time zone sessiontimezone, 'yyyy-mm-dd hh24:mi:ss (tzr)') ts2
from
dual;
--
-- TS1 TS2
-- ---------------------------- ----------------------------
-- 2023-08-22 08:17:31 (+00:00) 2023-08-22 05:17:31 (-03:00)
Trying to set the session's time zone to an unrecognized value:
alter session set time_zone = 'Europe/Berne';
--
-- ORA-01882: time zone region not found
Find available time zone values:
select * from v$timezone_names;