[freetds] Dates are returned by freetds with the month -1
Claude Renglet
c.renglet at nirond.be
Thu Jun 2 02:37:41 EDT 2005
more informations:
I've just discovered that a few days ago, my part of intranet site
doesn't have a php.ini, (we have two apaches running with to php
versions, one without mssql support, and the other with, yes, it can
seems strange but it worked fine since 2 years like that)
So, a few days ago, I've began to use session_start() but I received
every time error messages that the session can not be created. I've
discovered that the php temp session path must be different for the 2
running instances, and also that my second php instance doesn't have a
php.ini accessible, so I created one from the default php.ini-dist.
Since these updates, I think, sql dates didn't display correctly.
The same thing occured with the new php version (4.3.11)
I've just find in the php.ini that there is a key in the mssql section
that handels returned date format
[MSSQL]
...
mssql.compatability_mode =Off
...
setting this setting to "On", dates returns now correctly.
Thanks again
Claude
Claude Renglet wrote:
> Thanks Carlo,
>
> I've updated my php from 4.3.6 to 4.3.11, and everything comes back
> as normal.
>
> Thanks again for your answers
>
> Carlo Simeone wrote:
>
>> Il mer, 2005-06-01 alle 16:00, Claude Renglet ha scritto:
>>
>>
>>> thanks,
>>>
>>> I've didn't though these tests.
>>> Now I've did it, I'm more confused.
>>>
>>> from tsql command processor, everything perfect, dates are returned
>>> correctly either from getdate() or from table data.
>>> but from php, I've got the dates returned with the month - 1 yet,
>>> even with getdate()
>>>
>>>
>>
>>
>> Try with a newer PHP/FreeTDS version. I don't remember well when/where
>> this problem was corrected....
>> If you can't change it, try the follwing mini-patch:
>>
>> On "etx/mssql/php_mssql.c" put after both the sprintf lines:
>>
>> (sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year,
>> dateinfo.month, dateinfo.day,dateinfo.hour, dateinfo.minute,
>> dateinfo.second);
>>
>> this code:
>>
>> #if HAVE_FREETDS
>> dateinfo.month++;
>> #endif
>>
>> and
>>
>> #if HAVE_FREETDS
>> dateinfo.month++;
>> #endif
>>
>> Then, rebuild PHP.
>>
>> HTH
>>
>>
>>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
More information about the FreeTDS
mailing list