I am currently reporting file modification time as follows:
$this->newScanData[$key]["modified"] = filemtime($path."/".$file);
$modifiedtime = date($date_format." ".$time_format, $this->newScanData[$key]["modified"]);
For me, I thought that there was nothing wrong with that, but the user of my code reports that the time is 4 hours. The only reason I can think about this is because the server is in a different time zone for the user. Each user has a variable that I can use $gmt_offsetthat stores the time zone in which the user is located. $gmt_offsetstored as the base offset of the float.
The server can be in any time zone, not necessarily in GMT-0. The server may not be in the same time zone as the user.
How do I get $modifiedtimefor the right time for the user in his timezone based $gmt_offset?
source
share