Loading...

A simple Oracle DB function to convert timestamp to date

In Oracle BRM, all the time and date is stored in number format and it is required to convert them if you are reading it from the DB.
ORacle BRM - VirtualNuggets

Lots of developers write functions or utilities to convert it to date. Here is a similar function:

create
or replace function u2d(v_tstamp IN number)
return date
as
v_date date;

begin
v_date := to_date('01-JAN-1970', 'DD-MON-YYYY') + (v_tstamp+19800)/86400;
RETURN V_DATE;
END;
VirtualNuggets 8996587831269761234

Post a Comment

emo-but-icon

Home item

Blog Archive

Popular Posts

Random Posts

Flickr Photo