0

is there a way to change this:

  $modtime=date("M j Y g:i A", filemtime($dirArray[$index]));
  $timekey=date("YmdHis", filemtime($dirArray[$index]));

Print

<td sorttable_customkey='$timekey'  class='files_ed_02'>$modtime</td>

into gmdate and adding two hours to the stamp? Trying to show the local time for when a file was uploaded to the server.

Edit

Aware that this is a common question, but because gmdate() only can hold 2 parameters, it seams? this won't work

      $modtime=gmdate("M j Y g:i A",modtime()+(2*60*60), filemtime($dirArray[$index]));
      $timekey=gmdate("YmdHis",timekey()+(2*60*60), filemtime($dirArray[$index]));
4

1 回答 1

1

只需将 2 小时添加到您从中获得的 unix 时间戳filemtime

$modtime=date("M j Y g:i A", (filemtime($dirArray[$index]) + (2*60 * 60));

您不能将其作为单独的参数发送,filemtime 将返回一个整数,因此只需添加它即可。

于 2013-10-16T15:21:50.053 回答