Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: converting timestamp in milliseconds to date or vice-versa in oracle
Hi Rauf,
i got it ... just in case if you are interested.
select TO_DATE('1970-01-01', 'YYYY-MM-DD')+ max(numtodsinterval(to_number(timestamp_col)/1000,'SECOND')) from your_table;
where timestamp_col is the column name which stores the timestamp and your_table is the required table.
> On a side note... why use currentTimeMillis at all and store in
> varchar2 field?... why not use sysdate and store it properly in the
> Date column?
the timestamp is used for auditing purpose. it stores the timestamp precisely, which is required at some of the places in the system and the system is already in place so it would not be advisable to change the type now ;)
cheers
amey
Received on Fri Feb 04 2005 - 11:20:39 CST