tags:

views:

45

answers:

2

I have a PHP application using an Oracle XE database.

Whenever I add a date the hours minutes, and seconds seem to get left out.

Is there some special format, or type I should use to be able to store this? I have tried using to_date, and specifying the format I am using.

Many thanks for any suggestions from this confused MySql dveloper.

A: 

Does the column type in the Oracle database allow for hours, minutes and seconds?

matthewh
Th documentation seems to suggest Date allows HH:MM:SS
Matt
Oracle `DATE`s are internally stored with precision to the second. They're not, however, actually stored as a character string.
Jeffrey Kemp
+3  A: 

Oracle "date" types store both date & time, but by default when you view them they will display only the date. You can use a format string with to_char to change this. For example:

SQL> select sysdate as now from dual;

NOW
---------
09-apr-10

SQL> select to_char(sysdate,'yyyy/mm/dd hh:mi:ss AM') as now from dual;

NOW
----------------------
2010/04/09 07:43:47 AM
David Gelhar
Thanks. exactly the issue. Times were there all along.
Matt