The Duration function in Expression Builder returns a number that indicates a period in days or fractions of days as indicated by the period argument.
The following table describes the arguments for the function.
A string literal in the following format PnYnMnDTnHnM:
- P is the period indicator
- nY specifies the number of years between 0 and 5
- nM specifies the number of months between 0 and 12
- nD specifies the number of days between 0 and 200
- T separates the date and time specifications
- nH specifies the number of hours between 0 and 200
- nM specifies the number of minutes between 0 and 59
Note the following points:
- Do not specify a plus sign (+) for positive values.
- You can specify a negative duration as -Duration(Period).
- Specifying seconds is not supported.
- The maximum supported duration is 'P5Y12M200DT200H59M' (that is, 5 years, 12 months, 200 days, 200 hours, and 59 minutes).
- If the number of years, months, days, hours, or minutes is zero, you can omit the number and its corresponding designator.
- If the number of years, months, or days is zero and the time component is a nonzero value, at least one of the year, month, or day components (a number and its designator) must be present.
- If none of the time components are present in the period, the T designator must not be included in the period.
- The designator P must always be present in the period.
The following are valid examples of the Duration function:
See the following topics for related Expression Builder information: