Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: converting timestamp in milliseconds to date or vice-versa in oracle

Re: converting timestamp in milliseconds to date or vice-versa in oracle

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 4 Feb 2005 06:49:41 -0800
Message-ID: <1107528581.110762.38980@l41g2000cwc.googlegroups.com>

ameyas7_at_yahoo.com wrote:
> hey folks,
>
> we have a varchar2 col which stores the timestamps (records r added
frm
> java app which logs the currentTimeInMillis on that System)
> now i want to write a procedure which will delete records older than
> say 45 days
> i can get the current date using sysdate but this is in DATE format
> whereas my column is in varchar2 (also the value is in millis)
> how do i convert from millis to date or vice-versa
>
>
> regards
> amey

System.currentTimeMillis() as described in javadocs "the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC"... so good luck doing the calculation in PL/SQL.

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?

Regards
/Rauf Received on Fri Feb 04 2005 - 08:49:41 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US