Current time in SQL/Tcl

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
I need the cuurent time somehow either in Tcl or in SQL. I know how to
get the date (SysDate) but I could not find anything about the time.

-- Oskar Bruening, January 6, 2000


current time (seconds from 1970 blah blah) is [ns_time]

You can use Oracle to do select sysdate from dual

In Tcl, ns_fmttime lets you do strftime() style formatting.

-- Mark Dalrymple, January 6, 2000

read about to_char to get the time out of sysdate

-- Eve Andersson, January 6, 2000

Oracle stores date down to the second. Here is an example of selecting a full date/time:

select to_char(sysdate, 'YYYY-MM-DD HH:MI:SS') from dual

-- Jesse Koontz, January 6, 2000