Click or drag to resize
TimeSpanParse Method (String, IFormatProvider)
Converts the string representation of a time interval to its TimeSpan equivalent by using the specified culture-specific format information.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static TimeSpan Parse(
	string input,
	IFormatProvider formatProvider
)

Parameters

input
Type: SystemString
A string that specifies the time interval to convert.
formatProvider
Type: SystemIFormatProvider
An object that supplies culture-specific formatting information.

Return Value

Type: TimeSpan
A time interval that corresponds to input, as specified by formatProvider.
Exceptions
ExceptionCondition
ArgumentNullExceptioninput is null.
FormatExceptioninput has an invalid format.
OverflowExceptioninput represents a number that is less than MinValue or greater than MaxValue.-or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range.
See Also