Regardless of how I set the NLS_DATE_FORMAT parameter, when I do a select 
statement DATE fields are returned in the Oracle default DD-MON-RR format.

I can successfully set NLS_DATE_FORMAT using either an environment variable 
and restarting apache or by using ALTER SESSION SET NLS_DATE_FORMAT = 
'DD-MM-RRRR HH24:MI:SS' (I would prefer to use this method).

I can verify that the NLS_DATE_FORMAT is set to my desired format both before 
and after my select statement by running the query SELECT * FROM 

This problem occurs with both PEAR DB, and with ADODB oci8 drivers.  However 
if I use the ADODB oracle drivers, which use the older ora functions instead 
of the oci functions, ALTER SESSION works and I am able to retrieve dates in 
the format I set.  Unfortunately, the software I'm working on uses PEAR 
DB_DataObject, and the PEAR DB Oracle driver uses the oci calls.

Version info:
Oracle9i Enterprise Edition Release - 64bit Production
PHP 4.3.4
Apache 1.3.29

Anyone have any ideas or suggestions on why I'm seeing this problem?


PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to