Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 21.1
Syntax
Code Block
languagenone
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
Code Block
languagenone
create duration; 
set duration.years = 3; 
set duration.days = 10; 
set duration.minutes = 45; 
set newDateTime1 = aDateTime.add(duration); 
set newDateTime2 = aDateTime.subtract(duration);