Convert miliseconds to regular time?
#4

pawn Код:
stock ConvertMsToTime(ms)
{
    new seconds = ms/1000;
    new string[32];
    format(string, sizeof(string), "%02d:%02d:%02d - %02d:%02d:%02d",
        seconds/31536000, (seconds%31536000)/2592000, (seconds%2592000)/86400,
        (seconds%86400)/3600, (seconds%3600)/60, seconds%60);
    return string;
}
pawn Код:
sto = GetTickCount();
o = sto - sta;
printf("Server online for: %s", ConvertMsToTime(o));
But years and months are pointless to convert because you can't have that big values in milliseconds.
Reply


Messages In This Thread
Convert miliseconds to regular time? - by sciman001 - 04.05.2011, 22:34
Re: Convert miliseconds to regular time? - by Steven82 - 04.05.2011, 22:45
Re: Convert miliseconds to regular time? - by sciman001 - 04.05.2011, 22:55
Re: Convert miliseconds to regular time? - by MadeMan - 04.05.2011, 23:02
Re: Convert miliseconds to regular time? - by BigETI - 04.05.2011, 23:26

Forum Jump:


Users browsing this thread: 2 Guest(s)