note 30226 added to function.ocifetchinto

From: Date: Tue, 11 Mar 2003 17:10:21 +0000
Subject: note 30226 added to function.ocifetchinto
Groups: php.notes 
Request: Send a blank email to php-notes+get-45103@lists.php.net to get a copy of this message
By default Oracle 8i (and I guess 9i) return date type columns in the format "DD MON YY", which can be a problem if you want the time. You can convert these columns in your SELECT statements with the TO_CHAR function, but it is much nicer to make Oracle return ISO 8601 complient dates! Try setting an environment var for NLS_DATE_FORMAT before you connect to your DB. The following has worked for me in Apache & IIS on Windows... but it might work on *NIX? $datetime = 'YYYY-MM-DD HH24:MI:SS'; putenv("NLS_DATE_FORMAT=$datetime"); You can also set this up in the Windows registry: Key: "HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0" Make a new String value called "NLS_DATE_FORMAT" with a value of "YYYY-MM-DD HH24:MI:SS" Hope that this helps someone else. -- http://www.php.net/manual/en/function.ocifetchinto.php http://master.php.net/manage/user-notes.php?action=edit+30226 http://master.php.net/manage/user-notes.php?action=delete+30226 http://master.php.net/manage/user-notes.php?action=reject+30226

« previous php.notes (#45103) next »