TimeSpanParse Method (String) |
Converts the string representation of a time interval to its
TimeSpan equivalent.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static TimeSpan Parse(
string s
)
Parameters
- s
- Type: SystemString
A string that specifies the time interval to convert.
Return Value
Type:
TimeSpanA time interval that corresponds to
s.
Exceptions Exception | Condition |
---|
ArgumentNullException | s is null. |
FormatException | s has an invalid format. |
OverflowException | s represents a number that is less than MinValue or greater than MaxValue.-or- At least one of the days, hours, minutes, or seconds components is outside its valid range. |
See Also