Skip to content

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);

Parameters

Parameter Description
const string[] The text.
&Seconds:output The duration read.

Returns

  • true when it was read.
  • false when the text is not a duration or is longer than 68 years. output is left as it was.

Remarks

Milliseconds below a second are left out. Seconds reach 68 years in a cell, where milliseconds stop at 24 days.

Example

stock Timestamp:BanEnd(const text[]) {
    new
        Seconds:duration
    ;

    if (!DurationParseSeconds(text, duration)) {
        return INVALID_TIMESTAMP;
    }

    return Now() + duration;
}

Related

Clone this wiki locally