Ts3 Admin Class

francisco arsénio

Restricted
Joined
Sep 30, 2015
Messages
8
Reaction score
1
Points
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
Joined
May 20, 2016
Messages
264
Reaction score
107
Points
136
Just use
convertSecondsToStrTime function and pass there seconds
 

francisco arsénio

Restricted
Joined
Sep 30, 2015
Messages
8
Reaction score
1
Points
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
Joined
May 20, 2016
Messages
264
Reaction score
107
Points
136
Take a look in docs...
That might be something like $ts3_connect->convertSecondsToStrTime($ts3_connect->virtualserver_uptime)
 

kalle

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