Repository navigation
DurationFormat
imshooter edited this page Nov 26, 2026
·
1 revision
Write a duration as text.
native bool:DurationFormat(Seconds:duration, output[], size = sizeof (output), const format[] = "");| Parameter | Description |
|---|---|
Seconds:duration |
The duration. One below zero is written with - before it. |
output[] |
Array for the text. |
size |
Size of the array. |
const format[] |
The text with the specifiers of durations, or words when left out. |
-
truewhen it was written. -
falsewhen the format has a specifier it does not know.
With no format the duration is written in words, as 1 day, 2 hours, 3 minutes, 4 seconds, leaving out what is zero. A format takes %y, %d, %h, %m and %s, in two digits when in capitals, and each holds what the larger ones in the format leave. See Durations.
stock ShowJailTime(playerid, Seconds:left) {
new
text[16]
;
DurationFormat(left, text, .format = "%m:%S");
GameTextForPlayer(playerid, text, 1000, 3);
}-
DurationParse: Read a duration such as
1h 30m. - TimeFormat: Write a time as text.
Chrono 0.2.0 · Repository · Releases · MIT License
Guides
Reference
Functions