note 30226 deleted from function.ocifetchinto by sixd
| From: | sixd@php.net | Date: | Wed, 18 Nov 2009 22:50:43 +0000 |
| Subject: | note 30226 deleted from function.ocifetchinto by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163054@lists.php.net to get a copy of this message | ||
Note Submitter: dan at calleope dot fsnet dot com
----
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.