Duration(String) Constructor
Construct a duration from a string in ISO 8601 duration format
Definition
Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
C#
public Duration(
string? duration
)VB
Public Sub New (
duration As String
)C++
public:
Duration(
String^ duration
)F#
new :
duration : string -> DurationParameters
- duration String
- The ISO 8601 formatted duration to parse
Remarks
This parses a string in the form P#Y#M#W#DT#H#M#S to create a duration. '#' indicates a
string of one or more digits and the letters represent the years, months, weeks, days, hours,
minutes, and seconds. Any of the parts except the leading 'P' and the 'T' time separator can be
omitted entirely if not needed.
Exceptions
| ArgumentException | This is thrown if the specified duration string is not valid |