10.05.2011, 15:51
(
Последний раз редактировалось JaTochNietDan; 10.05.2011 в 16:31.
)
Here's a stock function I whipped up quickly to convert it for you:
Usage example:
Hope that's what you were looking for!
pawn Код:
/*Usage: The seconds parameter should be the amount of seconds you want to convert and
the rest of the parameters should be variables to store the integer value for each of the
time values*/
stock formatSeconds(seconds, &hours_left, &minutes_left, &seconds_left)
{
hours_left = seconds/60/60;
minutes_left = (seconds - hours_left*60*60)/60;
seconds_left = (seconds - hours_left*60*60 - minutes_left*60);
return 1;
}
pawn Код:
new
hours,
minutes,
seconds;
formatSeconds(5000, hours, minutes, seconds);
printf("Hours: %d, Minutes: %d, Seconds: %d in 5000 seconds", hours, minutes, seconds);
