php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47128 NLS_DATE_FORMAT
Submitted: 2009-01-16 14:55 UTC Modified: 2009-01-19 05:12 UTC
From: iteam dot soft at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.8 OS: Red Hat 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: iteam dot soft at gmail dot com
New email:
PHP Version: OS:

 

 [2009-01-16 14:55 UTC] iteam dot soft at gmail dot com
Description:
------------
For about a week ago I had installed on my box Apache 2.2.10 with PHP 
5.2.7. Beside this the php was compiled with FirebirdSql and Oracle 
Instant Client.

On apache start I put a env variabile
export NLS_DATE_FORMAT=DD.MM.YYYY

On my application start point from PHP I also double ensure the 
NLS_DATE_FORMAT it's set so I put also
putenv('NLS_DATE_FORMAT=DD.MM.YYYY');

Everything was ok and my application display the date format from 
oracle as I set it. All good.

Last week ... I made upgrade to Apache 2.2.11 and PHP 5.28.
After upgrade nothing change to my application or configuration only 
this applications (apacheand and php) as I mentioned above.

From this point the date format that I was getting from Oracle was 
NOT what I set.
The returned date format was in Oracle standard DD-M-RR.

So I try everything .. recheck ... reset env variables .. put extra 
configuration for php ... but no result. The same bad date.

I know I could use the alter session as a work-arround ... but this 
envolves running the alter session eache time user wants information 
from the database. The application it's huge and with a lot of users 
and it's running on the intranet system. 
So I preffer the PUTENV method.

So all was ok until the upgrade from apache 2.2.10 to 2.2.11 and php 
5.2.7 to 5.2.8








Reproduce code:
---------------
I try all this ... at once and one by one ... no result.

$_ENV["NLS_DATE_FORMAT"]  = 'DD.MM.YYYY';
putenv('NLS_DATE_FORMAT=DD.MM.YYYY');
apache_setenv('NLS_DATE_FORMAT=DD.MM.YYYY');

Expected result:
----------------
The Oracle date format to be:

22.01.2009

Actual result:
--------------
22-JAN-09

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-18 23:12 UTC] jani@php.net
And you immediately assume your bad configuration is a bug in 
PHP..pff..
 [2009-01-19 05:12 UTC] iteam dot soft at gmail dot com
The configuration of apache and php it's ok.
Everything works the same except this date issue.

I also ... installed again the php 5.2.7 with apache 2.2.11 and the 
date work just fine now ... with the "bad" configuration. The 
configuration files I keep ... and just replace the initials one.

If ... it's something wrong with my configuration ... which I don't 
see how it's possible for my server ... can you give me a hint.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Dec 01 07:00:01 2025 UTC