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!

Calculate date difference in Milliseconds

NikJunejaDec 23 2009 — edited Dec 23 2009
Hi All,

Version :- Oracle Database 10g Enterprise Edition Release 10.2.0.3.0

Requirement :- To calculate difference between current systimestamp and 1st Jan 1970 with precision upto milliseconds ( we require this to store in some table )

The query which I have given below it gives value upto precision 1 sec

select (sysdate - to_date('01-JAN-1970 00:00:00','DD-MON-YYYY HH24:MI;SS')) * (24 * 60 * 60 * 1000) from dual;

Output
1261545437000

After 1 sec
1261545439000 and so on

can i get difference to the precision in millisecond
This post has been answered by 730428 on Dec 23 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 20 2010
Added on Dec 23 2009
5 comments
12,390 views