GlideDateTime - getYearUTC()

Gets the year stored by the GlideDateTime object, expressed in the UTC time zone.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
number The 4-digit year value in the UTC time zone.

Scoped equivalent

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

var gdt = new GlideDateTime(); //2011
gs.print(gdt.getYearUTC());

Output: 2011