php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22060 mssql.datetimeconvert=0 gets wrong month
Submitted: 2003-02-04 17:11 UTC Modified: 2003-02-09 21:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cunha17 at uol dot com dot br Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.3.1-dev OS: Linux 2.4
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: cunha17 at uol dot com dot br
New email:
PHP Version: OS:

 

 [2003-02-04 17:11 UTC] cunha17 at uol dot com dot br
>>When using this:

$c = mssql_connect("172.16.0.1:1433", "hn", "hn");
mssql_select_db("hn");
$r = mssql_query("select * from hn.employee");
print_r(mssql_fetch_array($r));

>>I get this(as expected):
Array ( [0] => M4398648MG [id] => M4398648MG [1] => FRED [nome] => FRED [2] => 105 roadhouse, av [addr] => 105 roadhouse, av [3] => NY [city] => NY [4] => NY [state] => NY [5] => 70272 [zip] => 70272 [6] => 280876 [id2] => 280876 [7] => FRED [nick] => FRED [8] => Mar 17 1973 12:00AM [birth] => Mar 17 1973 12:00AM ) 
 
>>When using this:
ini_set('mssql.datetimeconvert',0);
$c = mssql_connect("172.16.0.1:1433", "hn", "hn");
mssql_select_db("hn");
$r = mssql_query("select * from hn.employee");
print_r(mssql_fetch_array($r));

>>I get a wrong month number (02 instead of 03):
Array ( [0] => M4398648MG [id] => M4398648MG [1] => FRED [nome] => FRED [2] => 105 roadhouse, av [addr] => 105 roadhouse, av [3] => NY [city] => NY [4] => NY [state] => NY [5] => 70272 [zip] => 70272 [6] => 280876 [id2] => 280876 [7] => FRED [nick] => FRED [8] => 1973-02-17 00:00:00 [birth] => 1973-02-17 00:00:00 ) 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-05 15:43 UTC] cunha17 at uol dot com dot br
same happened with php4-STABLE-200302052030.
 [2003-02-09 02:53 UTC] fmk@php.net
I need a bit more information to solve this. This can not be reproduced on my system.

Are you using datetime or smalldatetime ?
 [2003-02-09 14:16 UTC] cunha17 at uol dot com dot br
I?m running MSDE with SP5 on a Win98SE machine.
I?m running PHP/Apache on a Linux machine with freetds.
The type of the 'birth' column is datetime.
 [2003-02-09 17:06 UTC] fmk@php.net
Ok I can verify this then and it is not a bug in PHP. It is a bug in FreeTDS and I have asked for a fix.
 [2003-02-09 21:19 UTC] fmk@php.net
If you compile FreeTDS using --enable-msdblib, this problem will be fixed.

I'm trying to find a solution that will make the MSSQL extension work correctly with or without this option.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 10:01:31 2025 UTC