GlideDateTime - subtract(GlideTime time)

Subtracts a specified amount of time.

Table 1. Parameters
Name Type Description
time GlideTime The time to subtract
Table 2. Returns
Type Description
void

Scoped equivalent

To use the subtract() method in a scoped application, use the corresponding scoped method: Scoped GlideDateTime - subtract(GlideTime time).

var gdt = new GlideDateTime("2011-08-31 08:00:00");
var gtime1 = new GlideTime();
gtime1.setValue("00:00:20");
gdt.subtract(gtime1);
gs.print(gdt.getTime());

Output: 1970-01-01 07:59:40