Syntax
set resultDateTime = aDateTime.add(aDuration); 
set resultDateTime = aDateTime.subtract(aDuration);
Semantics

add() and subtract() add respectively subtract a duration to/from a DateTime object.

This is calculated e.g. as follows:

  1. 31.01.2017 + 1 month = 31.02.2017
  2. The resulting date 31.02.2017 is normalized to 03.03.2017.

For a deeper understanding of how you can calculate with DateTime objects, refer to DateTime Arithmetics.

SubstitutablesaDurationCan be any variable or object attribute having the type Base Components.Basic Behavior.DateTime.DurationStructure.  
resultDateTime The resulting DateTime object.
Examples
create duration; 
set duration.years = 3; 
set duration.days = 10; 
set duration.minutes = 45; 
set newDateTime1 = aDateTime.add(duration); 
set newDateTime2 = aDateTime.subtract(duration);
  • No labels