Цитата:
Сообщение от Desperado
Функция конверта времени из линукса
Код:
function conventNormTime($nSec) {
$d = floor( $nSec / (3600*24) );
$nSec = ($nSec - $d * 3600 * 24);
$h = floor( $nSec / 3600 );
$nSec = ($nSec - $h * 3600);
$m = floor( $nSec / 60 );
return "{$d} д. {$h} ч. {$m} м.";
}
|
А так
PHP код:
function unix_timestamp_to_human ($timestamp = "", $format = 'D d M Y - H:i:s')
{
if (empty($timestamp) || ! is_numeric($timestamp)) $timestamp = time();
return ($timestamp) ? date($format, $timestamp) : date($format, $timestamp);
}
не проще ли будет?