Home Duration Struct
Duration Struct
Cancel

Duration Struct

Namespace: Json.Schema

Inheritance: Duration 🡒 ValueType 🡒 object

Represents an ISO 8601 ABNF duration value.

Properties

NameTypeSummary
DaysuintThe number of days.
HoursuintThe number of hours.
MinutesuintThe number of minutes.
MonthsuintThe number of months.
SecondsuintThe number of seconds.
WeeksuintThe number of weeks. Incompatible with Json.Schema.Duration.Years, Json.Schema.Duration.Months, and Json.Schema.Duration.Days.
YearsuintThe number of years.

Methods

Parse(string source)

Parses a Json.Schema.Duration from a string.

Declaration

1
public static Duration Parse(string source)
ParameterTypeDescription
sourcestringThe source string.

Returns

A duration.

TryParse(string source, out Duration duration)

Parses a Json.Schema.Duration from a string.

Declaration

1
public static bool TryParse(string source, out Duration duration)
ParameterTypeDescription
sourcestringThe source string.
durationout DurationThe resulting duration.

Returns

true if the parse was successful; false otherwise.

Contents