In relation with this question, I'm getting a wrong value for the the modified date when querying the windows ADODB connection for indexing files.
This is the line or the query:
$recordset - > Open("SELECT System.ItemName, System.DateModified FROM SYSTEMINDEX WHERE DIRECTORY='file:C:/xxxx/' AND CONTAINS('xxxx')", $conn);
I've getting good results on localhost (php 5.5.6), but not in other servers (php 5.5.8). I'm getting the wrong timestamp
value and therefore it converts it into a wrong date when I use PHP functions to create my customized format:
date_default_timezone_set(ini_get('date.timezone'));
$date = $recordset->Fields->Item("System.DateModified")->Value;
$timestamp = variant_date_to_timestamp($date); //getting a wrong date here
$file['date'] => date('d-M-Y H:i:s', $timestamp);
There's a different of some hours between the expected result and the result I'm getting. (2 hours)
It seems to be related with the variant_date_to_timestamp
function of PHP.
I've already set the proper date.timezone
in the php.ini file and added the date_default_timezone_set
call before calling variant_date_to_timestamp
.
I'm using PHP 5.5.8.
I've found a similar problem/bug commented on 2004. It talks about the two hours difference as well. I find it difficult to believe it hasn't been solved yet.