DurationTo String(DurationMax Unit) Method
Convert the duration instance to its ISO 8601 string form with the specified maximum unit of time
Definition
Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
Returns the duration in ISO 8601 format
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
C#
public string ToString(
DurationMaxUnit maxUnit
)VB
Public Function ToString (
maxUnit As DurationMaxUnit
) As StringC++
public:
String^ ToString(
DurationMaxUnit maxUnit
)F#
member ToString :
maxUnit : DurationMaxUnit -> string Parameters
- maxUnit DurationMaxUnit
- The maximum unit of time that should be represented in the returned string
Return Value
StringReturns the duration in ISO 8601 format
Remarks
The conversion to string breaks the duration down by largest to smallest unit (years down to
seconds). This version allows you to specify the maximum unit of time that should be represented.
Any time in excess of the maximum time unit will be returned in the maximum time unit (i.e. PT1D will
be returned as P24H for a maximum time unit of hours, P1M2W5D will be returned as P7W for a maximum
time unit of weeks if a month is defined as 30 days).