DurationToString Method

Convert the duration instance to its ISO 8601 string form

Definition

Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public override string ToString()

Return Value

String
Returns the duration in ISO 8601 format

Remarks

The conversion to string breaks the duration down by largest to smallest unit (years down to seconds). As such, the string returned may not match the string it was parsed from if a unit in the input string exceeds a unit of time used when converting it back to a string (i.e. PT24H will be returned as P1D, P7W will be returned as P1M2W5D if a month is defined as 30 days). The overloaded version can be used to convert to a string with a maximum unit of time represented.

See Also