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.en.php

75 lines
1.2 KiB
PHP
Raw 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));
//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 " &amp; ";
echo "$uptime_secondes second";
if ($uptime_secondes > 1)
echo "s";
}
}
}
?>