74 lines
1.2 KiB
PHP
74 lines
1.2 KiB
PHP
|
<?php
|
|||
|
|
|||
|
$tsfile = "tmp/quit.ts";
|
|||
|
//$reprise = TRUE;
|
|||
|
|
|||
|
if ($reprise == FALSE)
|
|||
|
{
|
|||
|
if (!file_exists($tsfile))
|
|||
|
{
|
|||
|
$Date = mktime();
|
|||
|
$fp = fopen($tsfile,"w+");
|
|||
|
$Ligne = sprintf($Date);
|
|||
|
fwrite($fp,$Ligne);
|
|||
|
fclose($fp);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
$stamp = mktime() - implode(file($tsfile));
|
|||
|
$days = round($stamp / 86400);
|
|||
|
|
|||
|
//echo $stamp;
|
|||
|
//$actual_date = mktime();
|
|||
|
//echo ($actual_date - $stamp);
|
|||
|
|
|||
|
$uptime_annees = date("y",$stamp)-70;
|
|||
|
$uptime_mois = date("m",$stamp)-1;
|
|||
|
$uptime_jours = date ("j",$stamp)-1;
|
|||
|
$uptime_heures =date ("H",$stamp)-1;
|
|||
|
$uptime_minutes = date ("i",$stamp);
|
|||
|
$uptime_secondes = date ("s",$stamp);
|
|||
|
|
|||
|
if ($uptime_annees > 0)
|
|||
|
{
|
|||
|
echo "$uptime_annees ann<6E>e";
|
|||
|
if ($uptime_annees > 1)
|
|||
|
echo "s";
|
|||
|
echo ", ";
|
|||
|
}
|
|||
|
if ($uptime_mois > 0)
|
|||
|
{
|
|||
|
echo "$uptime_mois mois";
|
|||
|
echo ", ";
|
|||
|
}
|
|||
|
if ($uptime_jours > 0)
|
|||
|
{
|
|||
|
echo "$uptime_jours jour";
|
|||
|
if ($uptime_jours > 1)
|
|||
|
echo "s";
|
|||
|
echo ", ";
|
|||
|
}
|
|||
|
if ($uptime_heures > 0)
|
|||
|
{
|
|||
|
echo "$uptime_heures heure";
|
|||
|
if ($uptime_heures > 1)
|
|||
|
echo "s";
|
|||
|
echo ", ";
|
|||
|
}
|
|||
|
if ($uptime_minutes > 0)
|
|||
|
{
|
|||
|
echo "$uptime_minutes minute";
|
|||
|
if ($uptime_minutes > 1)
|
|||
|
echo "s";
|
|||
|
}
|
|||
|
if ($uptime_secondes > 0)
|
|||
|
{
|
|||
|
echo " & ";
|
|||
|
echo "$uptime_secondes seconde";
|
|||
|
if ($uptime_secondes > 1)
|
|||
|
echo "s";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|