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));
|
|
//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 year";
|
|
if ($uptime_annees > 1)
|
|
echo "s";
|
|
echo ", ";
|
|
}
|
|
if ($uptime_mois > 0)
|
|
{
|
|
echo "$uptime_mois month";
|
|
if ($uptime_mois > 1)
|
|
echo "s";
|
|
echo ", ";
|
|
}
|
|
if ($uptime_jours > 0)
|
|
{
|
|
echo "$uptime_jours day";
|
|
if ($uptime_jours > 1)
|
|
echo "s";
|
|
echo ", ";
|
|
}
|
|
if ($uptime_heures > 0)
|
|
{
|
|
echo "$uptime_heures hour";
|
|
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 second";
|
|
if ($uptime_secondes > 1)
|
|
echo "s";
|
|
}
|
|
|
|
}
|
|
}
|
|
?>
|