GlideDateTime - addWeeksLocalTime(Number weeks)

Adds a specified number of weeks to the current GlideDateTime object. A negative parameter subtracts weeks.

The method determines the local date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts weeks using the local date and time values.

Table 1. Parameters
Name Type Description
weeks Number The number of weeks to add. Use a negative number to subtract.
Table 2. Returns
Type Description
void

Scoped equivalent

To use the addWeeksLocalTime() method in a scoped application, use the corresponding scoped method: Scoped GlideDateTime - addWeeksLocalTime(Number weeks).

var gdt = new GlideDateTime("2011-08-31 08:00:00");
gdt.addWeeksLocalTime(-1);
gs.print(gdt.getDate());

Output: 2011-08-24