Page 1 of 1

Oracle Date and TIme format

Posted: Wed Apr 11, 2007 7:20 am
by lunny
Hi,

I seem to have some trouble collecting TIme and Date and inserting and retrieving them back.

$trackInsert = "INSERT INTO trackingDB (url,dateofHit,ipaddress) VALUES('$url', to_date(sysdate, 'dd-mm-yy hh24:mi:ss'),'158.858.11.249')";

And this works but when i perform a select statement from this table all i get back is the Date not the actual time. This was using a normal select statement for dateofhit column. Then we tried the following statement.

select to_char(dateofhit, 'Dy DD-Mon-YYYY HH24:MI:SS') from trackingDB;

Which returned back the time but showed all 00:00:00.

Any help ?

Re: Oracle Date and TIme format

Posted: Wed Apr 11, 2007 8:30 am
by volka
lunny wrote:'dd-mm-yy hh24:mi:ss'
typo?