Hi,
A DateTime value in MySQL is retrurned as a string in PHP with the following format :
Using the mssql library : "2006-10-27 09:46:09.210"
Using the odbc library : "27/oct./2006 9:51" (french configuration)
For a SmallDateTime value,
the mssql library returns : "2006-10-27 09:46:09"
The problem is that PHP may not convert such strings as expected (TBS uses strtotime() for parameter "frm").
The solution I have found for my work is to use CONVERT() in my SQL statement when I need to display dates.
SELECT CONVERT(VarChar(19),MyDate,120) AS DateX
|
It returns a string like "2006-10-27 09:46:09" which is always good for PHP.
I also use
CONVERT(VarChar(10),MyDate,112) AS DateX
|
It returns a string like "20061027" which is always good for both PHP and MySQL.