14.1.19 temps passé sur un espace en jours

This commit is contained in:
Fred Tempez 2024-02-03 09:55:38 +01:00
parent 0ce3f0d1cb
commit 28ee5e46a5
2 changed files with 7 additions and 3 deletions

View File

@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.4.18';
const ZWII_VERSION = '1.4.19';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';

View File

@ -1168,9 +1168,13 @@ class course extends common
self::$userStat['floor'] = helper::dateUTF8('%d %B %Y %H:%M', $floorTime);
self::$userStat['top'] = helper::dateUTF8('%d %B %Y %H:%M', $topTime);
$d = $topTime - $floorTime;
$d_hours = floor($d / 3600);
// Conversion de la différence en jours, heures et minutes
$d_days = floor($d / 86400); // 1 jour = 86400 secondes (24 heures * 60 minutes * 60 secondes)
$d_hours = floor(($d % 86400) / 3600);
$d_minutes = floor(($d % 3600) / 60);
self::$userStat['time'] = $d_hours . ' heures, ' . $d_minutes . ' minutes ';
// Affichage du résultat
self::$userStat['time'] = $d_days . ' jours, ' . $d_hours . ' heures, ' . $d_minutes . ' minutes ';
// Valeurs en sortie
$this->addOutput([