Export (0) Print
Expand All

XmlConvert.ToTimeSpan Method

Converts the String to a TimeSpan equivalent.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public static TimeSpan ToTimeSpan(
	string s
)

Parameters

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

Return Value

Type: System.TimeSpan
A TimeSpan equivalent of the string.

ExceptionCondition
FormatException

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

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft