n/oldblog
Archived
1
0
Fork 0
This repository has been archived on 2024-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
oldblog/modules/clop.php

74 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2023-04-30 21:28:42 +02:00
<?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 " &amp; ";
echo "$uptime_secondes seconde";
if ($uptime_secondes > 1)
echo "s";
}
}
}
?>