TimeSpanToString Method (String, IFormatProvider) |
Converts the value of the current
TimeSpan object to its equivalent string representation by using the specified format and culture-specific formatting information.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public string ToString(
string format,
IFormatProvider formatProvider
)
Parameters
- format
- Type: SystemString
A standard or custom TimeSpan format string. - formatProvider
- Type: SystemIFormatProvider
An object that supplies culture-specific formatting information.
Return Value
Type:
StringThe string representation of the current
TimeSpan value, as specified by
format and
formatProvider.
Exceptions Exception | Condition |
---|
FormatException | The format parameter is not recognized or is not supported. |
See Also