Click or drag to resize
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: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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: String
The string representation of the current TimeSpan value, as specified by format and formatProvider.
Exceptions
ExceptionCondition
FormatExceptionThe format parameter is not recognized or is not supported.
See Also