GlideDateTime - setMonth(Number month)

Sets the month stored by the GlideDateTime object to a specified value using the Java Virtual Machine time zone.

Use setMonthLocalTime() or setMonthUTC() instead of this method.

Table 1. Parameters
Name Type Description
month Number The month to change to.
Table 2. Returns
Type Description
void

var gdt = new GlideDateTime();
gdt.setMonth(1);
gs.print(gdt.getMonth());

Output: 1