Quote:
Originally posted by svrider
Hello all,
I'd like to extract the system date (or any date) with a format including the miliseconds (I don't know if this is a good english word... I'm looking for the thousandth of seconds...)
If I do :
select to_char(sysdate, 'YYYY-MM-DD HH24:MI S') from dual;
I have the seconds... what is the correct format string to add the thousandth ?
I need that to make a very very basic random so I figured why not use a fraction of a second...
If you have a better idea for a random number between... say 1 to 20, I'm all ears !
Thanks a million !
SvRider.
|
Hi,
i dont know how to format a 1000th of a second, but if you
are trying to generate a random number, along with the
date, try this SQL
SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI

S')
||':'||SUBSTR(ABS(DBMS_RANDOM.RANDOM),1,3)
FROM DUAL
Also to generate random numbers, you can use DBMS_RANDOM.