mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-16 06:55:56 +00:00
fix remaining time calculation
This commit is contained in:
@@ -108,10 +108,11 @@ class Client
|
|||||||
$this->loop->addPeriodicTimer(1, function () use ($data, $timeoutSection) {
|
$this->loop->addPeriodicTimer(1, function () use ($data, $timeoutSection) {
|
||||||
$this->timeConnected++;
|
$this->timeConnected++;
|
||||||
|
|
||||||
$carbon = Carbon::createFromFormat('s', str_pad($data->length * 60 - $this->timeConnected, 2, 0, STR_PAD_LEFT));
|
$secondsRemaining = $data->length * 60 - $this->timeConnected;
|
||||||
|
$remaining = Carbon::now()->diff(Carbon::now()->addSeconds($secondsRemaining));
|
||||||
|
|
||||||
$timeoutSection->clear();
|
$timeoutSection->clear();
|
||||||
$timeoutSection->writeln('Remaining time: '.$carbon->format('H:i:s'));
|
$timeoutSection->writeln('Remaining time: '.$remaining->format('%H:%I:%S'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user