Oracle Date and TIme format

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
lunny
Forum Newbie
Posts: 13
Joined: Mon Feb 19, 2007 8:33 am

Oracle Date and TIme format

Post 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 ?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Oracle Date and TIme format

Post by volka »

lunny wrote:'dd-mm-yy hh24:mi:ss'
typo?
Post Reply