05/03/2021 14:17
Código PHP:
stock ConvertTime(number)
{
new hours, mins, string[64], days = 0;
hours = floatround(number / 3600.0, floatround_floor);
mins = floatround((number / 60.0) - (hours * 60.0), floatround_floor);
if(hours >= 24)
{
days = floatround((hours/24.0), floatround_floor);
hours = hours % 24;
}
if(days > 0)
format(string, 64, "%d dia(s) e %d hora(s)", days, hours);
else if(hours > 0)
format(string, 64, "%d hora(s) e %d minuto(s)", hours, mins);
else if(mins > 0)
format(string, 64, "%d minuto(s)", mins, secs);
else
format(string, 64, "%d segundo(s)", secs);
return string;
}