I store date in the database under CREATED using select sysdate from dual and it will store the value 9/12/2012 9:26:05 AM Which is exactly what I want.
However, when I retrieve the information with PHP (e.g $query[0]['CREATED']) it returns 12-SEP-12
How can I prevent this?
When you retrieve a date, it has to converted from an abstract representation of a point-in-time to a string of characters. If you don’t specify a format, it will use one by default (usually
NLS_DATE_FORMAT):If you want a specific format, you have to use a conversion function, such as
TO_CHAR: