If you are running with the latest version of PHP & SQL Server on Windows. Make sure you control how dates are formatted especially for smalldatetime. If you let PHP use its built in function you could get strange results ranging from Chinese to French. Jui isn’t the same as Jul and that confuses strtotime().

To disable PHP’s MSSQL date converter.

In PHP.ini

mssql.datetimeconvert = 0

In your code

ini_set('mssql.datetimeconvert', 0);

You may also want to make sure that all queries are formatted for your target locale. Here is an example for US English.

@ mssql_query("EXEC sp_configure 'default language', 0; RECONFIGURE;");
@ mssql_query("SET LANGUAGE us_english");
@ mssql_query("SET DATEFORMAT ymd;");