Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create or replace function utc_to_oracle (utc_in in number) return date is
begin
return to_date('01.01.70','dd.mm.rr')+(utc_in/(60*60*24));
end;
/
create or replace function utc_from_oracle (date_in in date) return number is
begin
return (date_in-to_date('01.01.70','dd.mm.rr'))*(60*60*24);
end;
/
SQL> col a heading "Hallux's UTC|to Oracle" format a20
SQL> select to_char(utc_to_oracle(983898064),'yyyy-mm-dd hh24:mi:ss') a from dual;
Hallux's UTC
to Oracle
--------------------
2001-03-06 17:01:04
SQL> col b heading "Hallux's|Date to|UTC" format 999999999
SQL> select utc_from_oracle(to_date('2001-03-06 17:01:04','yyyy-mm-dd hh24:mi:ss')) b from dual;
Hallux's
Date to
UTC
----------
983898064
SQL>