create or replace function date_to_unix_ts( PDate in date ) return number is
l_unix_ts number;
begin
l_unix_ts := ( PDate - date '1970-01-01' ) * 60 * 60 * 24;
return l_unix_ts;
l_unix_ts number;
begin
l_unix_ts := ( PDate - date '1970-01-01' ) * 60 * 60 * 24;
return l_unix_ts;
end;
create or replace function unixts_to_date(p_timestamp number) return date
as
begin
return to_date('1970-01-01','YYYY-MM-DD') +
numtodsinterval(p_timestamp,'SECOND');
end unixts_to_date;