Bug 760976

Summary: FreeTDS returns distorted datetime values when mssql.datetimeconvert=Off in php.ini
Product: [Fedora] Fedora EPEL Reporter: Dmitry Khokhlov <dmitry.hohlov>
Component: freetdsAssignee: Dmitry Butskoy <dmitry>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el5CC: dmitry
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-07 14:15:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dmitry Khokhlov 2011-12-07 13:53:43 UTC
Description of problem:
PHP began to receive wrong datetime values from mssql_query function after upgrading of freetds package. For example 
'2011-11-29 20:00:00' from database becomes '2011-04-11 00:03:20' in PHP. Downgrading this package back to the 0.64 version resolves this problem.

Version-Release number of selected component (if applicable):
freetds-0.91-1.el5.x86_64

How reproducible:
I think it can be reproduced without any problems

Steps to Reproduce:
1. Install freetds-0.91-1.el5.x86_64
2. Add mssql.datetimeconvert=Off to php.ini
3. Select any datetime value in PHP script from SQL Server database with mssql_query
  
Actual results:
The value will be distorted.

Expected results:
The same value as Microsoft SQL Server Management Studio shows.

Additional info:
SQL Server 10.50.1600.1 on Windows Server 2008 R2 Datacenter SP1
PHP 5.2.17 on CentOS 5.7

Comment 1 Dmitry Butskoy 2011-12-07 14:15:39 UTC
Well,

Since the version of 0.84, "date format" defaults are changed for "default" and "en_US" locales in /etc/locales.conf:

was: date format = %b %d %Y %I:%M%p
now: date format = %b %e %Y %I:%M:%S:%z%p

Try to revert the change (fe. as for es_ES locale) -- it should help you.

If not, please, reopen this bug.