This set of actions works with the Duration Ruleset variable type.
AddDurationToDateTime
Adds a Duration value (Duration) to a DateTime value (DateTime) and returns a DateTime value.
Example: P1Y2M3DT4H5M6.007S plus 2023-01-23T12:34:56.000-05:00 returns 2024-03-26T16:40:02.007-04:00
Notes:
- If DateTime is null, then returns null.
- If Duration is null, then returns DateTime.
CalculateDuration
Subtracts a DateTime value (DateTime2) from another DateTime value (DateTime1) and returns a Duration value.
Example: 2024-03-26T16:40:02.007-04:00 minus 2023-01-23T12:34:56.000-05:00 returns P1Y2M5DT4H5M6.007S
Notes:
- If DateTime is null, then returns null.
- If Duration is null, then returns DateTime.
CreateDuration
Creates a Duration value by specifying input properties (Years, Months, Days, Hours, Minutes, Seconds, Mills); allows for indicating if the Duration value IsNegative with a Boolean variable set to true.
Example: Using 1, 2, 3, 4, 5, 6, and 7 for the input properties returns P1Y2M3DT4H5M6.007S
Notes:
- If any value is negative, then causes an exception (no validation).
- At least one digit is required, otherwise returns an exception (no validation).
- 0 in any position is valid. Example: you can have a duration of 0.
- Any number from 0 to any positive number is valid.
- When isNegative is anything but true (or a true boolean variable), then the value defaults to false.
Duration Equals
Determines if two Duration values (SourceDuration1 and SourceDuration2) are equal and returns a Boolean value.
Notes:
- If equal, returns true.
- If both null, returns true.
- If one is null, returns false.
SubtractDurationFromDateTime
Subtracts a Duration value (Duration) from a DateTime value (DateTime) and returns a DateTime value.
Example: 2024-03-26T16:40:02.007-04:00 minus P1Y2M3DT4H5M6.007S returns 2023-01-23T12:34:56.000-05:00
Comments
0 comments
Please sign in to leave a comment.