Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

LONG to DATE

762436Jul 13 2010 — edited Jul 13 2010
I have the object java.util.Date with value "01/06/2010 00:00:00" and whose long value is 1180666800000.
The CMSDK do this to save datetimes into database in number column's.

How can I do to convert long datatype to date in PL/SQL ?

I tryed the statement SELECT below, but the problem is that the result witch returns 3 hours above( 01/06/2010 03:00:00 when I expected 01/06/2010 00:00:00, June 1st this format is dd/mm/yyyy hh24:mi:ss )

select to_char(to_date('01-JAN-1970','DD-MON-YYYY') + ( 1180666800000 / (60 * 60 * 24 * 1000) ),'DD-MON-YYYY HH24:MI:SS') "New Date" from sys.dual ;

thank guys,
Luciana Angeli

Edited by: Luciana T. Angeli on Jul 13, 2010 9:48 AM

Edited by: Luciana T. Angeli on Jul 13, 2010 9:55 AM

Edited by: Luciana T. Angeli on Jul 13, 2010 10:11 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2010
Added on Jul 13 2010
18 comments
8,656 views