Time convert
#4

Quote:
Originally Posted by ImTobi
Посмотреть сообщение
Hey To all,
How can i convert the time fom milliseconds to seconds or minutes?
1 millisecond = 0.001 seconds

Try this function.

Код:
forward ConvertMilliseconds(millisecond, &hours, &minutes, &seconds) 
public ConvertMilliseconds(millisecond, &hours, &minutes, &seconds) 
{
       if (millisecond < 0) return false;
       sec = millisecond / 1000; 
       minutes = secs / 60; seconds = secs % 60;
       hours = minutes / 60; minutes = minutes % 60;
       return true;
}
How to use?
Код:
new h, m, s;
ConvertMilliseconds(4126623, h, m, s);
printf("12335454667 milliseconds:  %d: %d: %d", h, m, s);
Reply


Messages In This Thread
Time convert - by ImTobi - 24.10.2017, 20:49
Re: Time convert - by CodeStyle175 - 24.10.2017, 20:53
Re: Time convert - by ImTobi - 24.10.2017, 20:59
Re: Time convert - by kingmk - 24.10.2017, 21:00
Re: Time convert - by ImTobi - 24.10.2017, 21:02
Re: Time convert - by kingmk - 24.10.2017, 21:03
Re: Time convert - by ImTobi - 24.10.2017, 21:07
Re: Time convert - by CodeStyle175 - 24.10.2017, 21:52
Re: Time convert - by Danisoni - 24.10.2017, 22:07
Re: Time convert - by NeewFooX - 25.10.2017, 13:26

Forum Jump:


Users browsing this thread: 4 Guest(s)