Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Parse

static func Parse(value: string) -> Result<Duration, DateTimeParseError>

Declaring type: Duration
Module: System.Time
Assembly: System.Runtime.dll
Source file: Duration.rvn

Parses invariant [-][d.]hh:mm:ss[.fraction], with 1–8 day digits and 1–7 fraction digits.

Parameters

Name Type Description
value String Complete ASCII text without whitespace or a leading plus sign.

Return value

Result<Duration, DateTimeParseError>

The duration, or InvalidFormat for unsupported syntax or OutOfRange for invalid fields or tick overflow.

Remarks

Leading day zeros are accepted within the eight-digit bound. Full signed Int64 ticks are supported.