Scoped GlideSchedule - add(GlideDateTime startDate, GlideDuration offSet)

Adds a new schedule segment to the current schedule.

Table 1. Parameters
Name Type Description
startDate GlideDateTime The starting date of the new schedule segment.
offSet GlideDuration The time offset of the new schedule segment.
Table 2. Returns
Type Description
GlideDateTime The schedule updated with the new schedule segment.
var startDate = new GlideDateTime('2014-01-02');
var days = 2;
var dur = new GlideDuration(60 * 60 * 24 * 1000 * days);
var schedule = new GlideSchedule();
var end = schedule.add(startDate, dur);
gs.info(end);
Output:
2014-01-04 00:00:00