GlideDateTime - setYear(Number year)

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

Use setYearLocalTime() or setYearUTC() instead of this method.

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

var gdt = new GlideDateTime();
gdt.setYear(2013);
gs.print(gdt.getYear());

Output: 2013