错误的日期时间 - PHP + SQL Server

echo date('d/m/Y H:i:s'); 
//output: 13/12/2012 11:10:57

print_r(getDataArray($dblink, 'select current_timestamp')); 
//output: Array ( [0] => Array ( [computed] => **2012-04-12 11110:05** ) )

When I try to get a "current_timestamp" + php + sql server, I get an error, an incorrect date. Can anyone help me?

  • date convert in mssql config (php.ini) is "off"

that's a problem in locale.conf ? /etc/locale.conf ....

thanks

The problem can be with the format that datetime columns are returned in.

Try this in your php.ini :

After this line:

;mssql.datetimeconvert = On

Add this line:

mssql.datetimeconvert = Off

Try:

After connection execute query:

SET DATEFORMAT ymd;

PHP:

odbc_exec($conn, "SET DATEFORMAT ymd");