=?windows-1256?q?datetime_problem_in_php_with_mssql=2Ed?= =?windows-1256?q?atetimeconvert_=3D_Off=FE?=

wamon <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
The format of my previous email was totally messed up. So I'm sending it again.

Hi,
I have a new setup of centos 6.2 with following packages installed:

[root@centos6 ~]# rpm -qa|grep php
php-devel-5.3.3-3.el6_2.8.i686
php-common-5.3.3-3.el6_2.8.i686
php-5.3.3-3.el6_2.8.i686
php-ldap-5.3.3-3.el6_2.8.i686
php-mysql-5.3.3-3.el6_2.8.i686
php-cli-5.3.3-3.el6_2.8.i686
php-pdo-5.3.3-3.el6_2.8.i686
php-mssql-5.3.3-1.el6.i686
[root@centos6 ~]# rpm -qa|grep freetds
freetds-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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.