Можно так:
/**
* Получит время последней модификации файла в нужном формате
*
* @param type $filePath - полный путь к файлу на сервере
* @param type $timeFormat - требуемый формат - по умолчанию DateTime::W3C
* @return W3C_datatime_string - строка содержащая время модификации
*/
function getLastModeTime($filePath, $timeFormat = \DateTime::W3C)
{
$result = false;
$time = filemtime($filePath); // можно подавить исключение @filemtime()
if ($time) {
$result = date($timeFormat, $time);
}
return $result;
}
Или стандартными функциями:
date('Y-m-d H:i:s', filemtime($filePath))