Click or drag to resize
TimeSpanToString Method (String)
Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public string ToString(
	string format
)

Parameters

format
Type: SystemString
A standard or custom TimeSpan format string.

Return Value

Type: String
The string representation of the current TimeSpan value in the format specified by the format parameter.
Exceptions
ExceptionCondition
FormatExceptionThe format parameter is not recognized or is not supported.
See Also