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: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax 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:
TimeSpanA time interval that corresponds to
input, as specified by
formatProvider.
Exceptions Exception | Condition |
---|
ArgumentNullException | input is null. |
FormatException | input has an invalid format. |
OverflowException | input 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