Skip to Content.
Sympa Menu

freetds - [freetds] datetime problem in php with mssql.datetimeconvert = Off

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: wamon <amonw AT hotmail.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] datetime problem in php with mssql.datetimeconvert = Off
  • Date: Tue, 3 Jul 2012 10:32:05 +0800


Hi,I have a new setup of centos 6.2 with following packages
installed:[root@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@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

>From amonw AT hotmail.com Mon Jul 2 22:59:46 2012
Return-Path: <amonw AT hotmail.com>
X-Original-To: freetds AT lists.ibiblio.org
Delivered-To: freetds AT lists.ibiblio.org
Received: by lists.ibiblio.org (Postfix, from userid 20217)
id 6F432E8BAC; Mon, 2 Jul 2012 22:59:46 -0400 (EDT)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
mailman1.ibiblio.org
X-Spam-Level:
X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,
RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
Received: from blu0-omc2-s14.blu0.hotmail.com (blu0-omc2-s14.blu0.hotmail.com
[65.55.111.89])
by lists.ibiblio.org (Postfix) with ESMTP id A1140E8BA5
for <freetds AT lists.ibiblio.org>; Mon, 2 Jul 2012 22:59:45 -0400 (EDT)
Received: from BLU169-W125 ([65.55.111.71]) by blu0-omc2-s14.blu0.hotmail.com
with Microsoft SMTPSVC(6.0.3790.4675);
Mon, 2 Jul 2012 19:59:45 -0700
Message-ID: <BLU169-W1255AAA406959239A11E4EBB5E90 AT phx.gbl>
X-Originating-IP: [65.38.69.115]
From: wamon <amonw AT hotmail.com>
To: <freetds AT lists.ibiblio.org>
Date: Tue, 3 Jul 2012 10:59:45 +0800
Importance: Normal
Content-Type: text/plain; charset="windows-1256"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
X-OriginalArrivalTime: 03 Jul 2012 02:59:45.0374 (UTC)
FILETIME=[E692F7E0:01CD58C7]
Subject: [freetds] =?windows-1256?q?datetime_problem_in_php_with_mssql=2Ed?=
=?windows-1256?q?atetimeconvert_=3D_Off=FE?=
X-BeenThere: freetds AT lists.ibiblio.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
List-Id: FreeTDS Development Group <freetds.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/freetds>
List-Post: <mailto:freetds AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Jul 2012 02:59:46 -0000


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



  • [freetds] datetime problem in php with mssql.datetimeconvert = Off, wamon, 07/02/2012

Archive powered by MHonArc 2.6.24.

Top of Page