Ts3 Admin Class

francisco arsénio

Restricted
Sep 30, 2015
8
1
53
How to convert $ts3['virtualserver_uptime'] only to says example:
Server have 89585 seconds and i want he say have 1 Day 0 Hours and 54 Minutes
 

FromLondon

Honk Honk
TeamSpeak Developer
VIP
May 20, 2016
264
107
136
Just use
convertSecondsToStrTime function and pass there seconds
 

francisco arsénio

Restricted
Sep 30, 2015
8
1
53
Just use
convertSecondsToStrTime function and pass there seconds
Hey dont work for me but i had resolve with this.

function secondsToTime($seconds) {
$dtF = new DateTime("@0");
$dtT = new DateTime("@$seconds");
return $dtF->diff($dtT)->format('%a days, %h hours and %i minutes');
}
$server_uptime = secondsToTime($ts3_connect->virtualserver_uptime);
echo $server_uptime;
 

FromLondon

Honk Honk
TeamSpeak Developer
VIP
May 20, 2016
264
107
136
Take a look in docs...
That might be something like $ts3_connect->convertSecondsToStrTime($ts3_connect->virtualserver_uptime)
 

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
That function is buggy for me also. I used it before but switched to Scp version od framework and no worrys. :p
 
Top