DurationCalculator - calcDuration(Number seconds)

Calculates an end date and time based on a specified start datetime and duration (seconds).

Upon completion, this.endDateTime, this.seconds, and this.totalSeconds properties are set to indicate the results of the calculation. Prior to calling this method, you must call setStartDateTime() with the start time to use in the computation.

Table 1. Parameters
Name Type Description
seconds Number Number of seconds to add to the startDateTime to compute the other values.
Table 2. Returns
BooleanFalse if input value is not a number.

var gdt = new GlideDateTime("2012-05-01 00:00:00");
if(!dc.calcDuration(2*24*3600)){ // 2 days
  gs.log("*** Error calculating duration");