System.Xml.XmlConvert.ToTimeSpan Method

Converts the string to a TimeSpan equivalent.

Syntax

public static TimeSpan ToTimeSpan (string s)

Parameters

s
The string to convert. The string format must conform to the W3C XML Schema Part 2: Datatypes recommendation for duration.

Returns

A TimeSpan equivalent of the string.

Exceptions

TypeReason
FormatException s is not in the correct format to represent a TimeSpan value.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0