GlideDateTime - addDaysUTC(Number days)

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

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

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

Scoped equivalent

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

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

Output: 2011-08-30