DurationToDescription(DurationMaxUnit) Method

Convert the duration instance to a text description with the specified maximum unit of time

Definition

Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public string ToDescription(
	DurationMaxUnit maxUnit
)

Parameters

maxUnit  DurationMaxUnit
The maximum unit of time that should be represented in the returned string

Return Value

String
Returns the duration description

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 24 hours for a maximum time unit of hours, P1M2W5D will be returned as 7 weeks for a maximum time unit of weeks if a month is defined as 30 days).

See Also