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!

sysdate and milliseconds

ChrisOct 15 2012 — edited Oct 15 2012
Hello,

I am converting a piece of java code to PL/SQL but I have one problem left in this part:
String url = String.format("%s/%s/%s.pdf",
"/doma/gijz/lh",
directory,
(new Date()).getTime());

In java I will get something like this "/doma/gijz/lh/pdf/1350287404314.pdf
1350287404314 is the number of milliseconds after januari 1, 1970.

In Oracle I tryed this one but it does not give me the same precission.
select to_number(sysdate - to_date('01-01-1970','dd-mm-yyyy' )) *24 *60*60 *1000 from dual;
1350296586000 < missing the milliseconds.
I tryed to use timestamp but I cant figure out how get milliseconds from a timestamp.

Anyone know a solution?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2012
Added on Oct 15 2012
15 comments
55,322 views