Repository navigation
DurationParseSeconds
imshooter edited this page Nov 26, 2026
·
1 revision
Read a duration as DurationParse does, to the second.
native bool:DurationParseSeconds(const string[], &Seconds:output);| Parameter | Description |
|---|---|
const string[] |
The text. |
&Seconds:output |
The duration read. |
-
truewhen it was read. -
falsewhen the text is not a duration or is longer than 68 years.outputis left as it was.
Milliseconds below a second are left out. Seconds reach 68 years in a cell, where milliseconds stop at 24 days.
stock Timestamp:BanEnd(const text[]) {
new
Seconds:duration
;
if (!DurationParseSeconds(text, duration)) {
return INVALID_TIMESTAMP;
}
return Now() + duration;
}-
DurationParse: Read a duration such as
1h 30m. - DurationFormat: Write a duration as text.
Chrono 0.2.0 · Repository · Releases · MIT License
Guides
Reference
Functions