select * from V$TIMEZONE_NAMES;
select TZ_OFFSET('+8:00') from dual;
select TZ_OFFSET('Africa/Abidjan') from dual;
select TZ_OFFSET(dbtimezone) from dual;
select TZ_OFFSET(sessiontimezone) from dual;
select substr(TZ_OFFSET(sessiontimezone),1,3) from dual;
select to_number(substr(TZ_OFFSET(sessiontimezone),1,3))/24 from dual;
select to_char(sysdate + to_number(substr(TZ_OFFSET(sessiontimezone),1,3))/24, 'yyyymmdd hh24:mi:ss') from dual;
create or replace function get_localtime_from_utc
(
i_utc_time in date
) return date
as
begin
return sysdate + to_number(substr(TZ_OFFSET(sessiontimezone), 1, 3)) / 24;
exception
when others then
return i_utc_time;
end get_localtime_from_utc;
/
select to_char(get_localtime_from_utc(sysdate), 'yyyymmdd hh24:mi:ss') from dual;