24.10.2017, 21:00
Quote:
Hey To all,
How can i convert the time fom milliseconds to seconds or minutes? |
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; }
Код:
new h, m, s; ConvertMilliseconds(4126623, h, m, s); printf("12335454667 milliseconds: %d: %d: %d", h, m, s);