Thread: [Pedido] Converter Tempo
View Single Post
Old 02/06/2020, 01:48 AM   #5
MasterWinX
Big Clucker
 
MasterWinX's Avatar
 
Join Date: Mar 2019
Location: San Fierro
Posts: 94
Reputation: 1
Default Re: Converter Tempo

tentei assim:

PHP Code:
stock ConvertDay(number)
{
    
number gettime() + (number 86400);
    new 
hours 0mins 0secs 0string[100];
    
hours floatround(number 3600);
    
mins floatround((number 60) - (hours 60));
    
secs floatround(number - ((hours 3600) + (mins 60)));
    new 
days 0;
    if(
hours >= 24)
    {
        
days floatround((hours/24), floatround_floor);
        
hours hours 24;
    }
    if(
days 0)
    {
        if(
days == 1)
            
format(string100"%d dia, %02d:%02d:%02d"dayshoursminssecs);
        else
              
format(string100"%d dias, %02d:%02d:%02d"dayshoursminssecs);
    }
    else if(
hours 0)
    {
        
format(string100"%02d:%02d:%02d"hoursminssecs);
    }
    else
    {
        
format(string100"%02d:%02d"minssecs);
    }
    return 
string;

e não funcionou
__________________
MasterWinX is online now   Reply With Quote