[Pedido] Converter Tempo
#5

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
Reply


Messages In This Thread
Converter Tempo - by MasterWinX - 02.06.2020, 01:12
Re: Converter Tempo - by k2bi - 02.06.2020, 01:17
Re: Converter Tempo - by MasterWinX - 02.06.2020, 01:23
Re: Converter Tempo - by darkxdll - 02.06.2020, 01:25
Re: Converter Tempo - by MasterWinX - 02.06.2020, 01:48
Re: Converter Tempo - by Locky_ - 02.06.2020, 20:24

Forum Jump:


Users browsing this thread: 2 Guest(s)