Question about querying oracledate data in php? A problem occurred when I used the oci function to query oracle data a few days ago. that is, when I found data of the date type, I used plsql to query the data in the oracle database, which is 2009-9-2912: 12: 12 & nbsp; but the query using the select * fromtablename statement, the query of oracle date data in php obtained by using the oci_fetch_array () function?
A problem occurred when I used the oci function to query oracle data recently. that is, when I found date data, I used pl/SQL to query the data displayed in the oracle database.
9-9-29 12:12:12
However, if you use the select * from tablename statement to query, the value of this time field obtained by using the oci_fetch_array () function is
September 30-09
How can I convert the field in this format to the above field, or how can I transfer the field in the above format to the time field in php?
Because I am not sure which field the time field is when I query it, I cannot use the time function in the oracle database to convert the specified field. it is best to convert it in php.
Thank you for your advice.
------ Solution --------------------
If the int type is used for the field storing the time, this problem will not occur. when the database is inserted, the time is converted to the timestamp for insertion. after reading the data, the timestamp is used to restore it to the time, this can improve the query time efficiency. You can also avoid the above situation!
------ Solution --------------------
Let's take a look at the official php example of oralce:
Http://www.oracle.com/technology/global/cn/pub/articles/oracle_php_cookbook/fuecks_dates.html
Try this way (just my understanding ):
Select name, to_char (regtime, 'DD-MM-YYYY HH: MI: SS') from tablename;
------ Solution --------------------
Positive solution on the third floor