Timestamp PHP à ce jour
<?php
echo date('m/d/Y H:i:s', 1541843467);
?>
Heinz
<?php
echo date('m/d/Y H:i:s', 1541843467);
?>
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
function ago($time) {
$timediff=time()-$time;
$days=intval($timediff/86400);
$remain=$timediff%86400;
$hours=intval($remain/3600);
$remain=$remain%3600;
$mins=intval($remain/60);
$secs=$remain%60;
if ($secs>=0) $timestring = "0m".$secs."s";
if ($mins>0) $timestring = $mins."m".$secs."s";
if ($hours>0) $timestring = $hours."u".$mins."m";
if ($days>0) $timestring = $days."d".$hours."u";
return $timestring;
}
echo ago(1334214962);
echo (time() - $post_timestamp) . " seconds ago";