Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accurate date 1

Status
Not open for further replies.

Kenrae

Programmer
Feb 7, 2001
174
ES
How can I convert a date to milliseconds? I've only managed to have a varchar2 with the seconds...

Thanks
 
I don't think you can, Oracle's date functionality only holds dates to a second prescion. if you want to get a time in milliseconds (for timing purposes) then you can use the view V$TIMER which has 1 column called HSECS. this holds seconds to 3dp. alternatively you can use DBMS_UTILITY.GET_TIME which returns the same values. This time is based on the number of seconds since some O/S specific epoch and rolls over every 4 days or so. However I'm not sure this is what you want.

Don't do what I did and use to_char(sysdate,'SSSS') as this isn't milliseconds (as I thought) but the number of seconds since midnight...

HTH,

Mike.
 
If you're on 8i, you may write java procedure, if not - try to use dbms_utility.get_time, but it returns 100th's of a second.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top