Discussion:
[freetds] datetime problem in php with mssql.datetimeconvert = Off
wamon
2012-07-03 02:32:05 UTC
Permalink
Hi,I have a new setup of centos 6.2 with following packages installed:[root at centos6 ~]# rpm -qa|grep phpphp-devel-5.3.3-3.el6_2.8.i686php-common-5.3.3-3.el6_2.8.i686php-5.3.3-3.el6_2.8.i686php-ldap-5.3.3-3.el6_2.8.i686php-mysql-5.3.3-3.el6_2.8.i686php-cli-5.3.3-3.el6_2.8.i686php-pdo-5.3.3-3.el6_2.8.i686php-mssql-5.3.3-1.el6.i686[root at centos6 ~]# rpm -qa|grep freetdsfreetds-0.91-2.el6.i686
I have a simple test php program as followed:<?php// connect database ...$rs=mssql_query("select cast(getdate() as varchar),getdate()");$row=mssql_fetch_row($rs);print_r($row);?>With mssql.datetimeconvert = On in php.ini, I got:Array( [0] => Jul 2 2012 10:23PM [1] => Jul 2 2012 10:23:39:073PM)But with mssql.datetimeconvert = Off, I got this strange result:Array( [0] => Jul 2 2012 10:25PM [1] => 2012-03-07 13625386)
Could anyone tell me how to fix it?Thanks,
Amonw

Loading...