Hi,
I need to write a function which has two input parameters.
Parameter1 => Date data type, value is in GMT.
Parameter1 => String value which indicates the time offset and it has the following format.
GMT(sign)HH24Mi
for examples:
GMT+400 , GMT-1400
I need add the offset (param2) to the date (param1) and returns as the output.
I wrote a simple code but can't get it to work. I would like to know if there is an another way to do it.
create or replace
Function F_FUNCTION_NAME(dt date,timeZoneOffset in varchar2)
return date
As
offset varchar2(9);
Begin
Offset := (To_Char(Substr(Substr(Timezoneoffset,4),0,Length(Substr(Timezoneoffset,4))-2)||':'||Substr(Substr(Timezoneoffset,4),-2)));
return Dt + interval Offset hour to minute;
End;
Thank You.