GlideDateTime - getYearLocalTime()

Gets the year stored by the GlideDateTime object, expressed in the current user's time zone.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Number The 4-digit year value in the user's time zone.

Scoped equivalent

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

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

Output: 2011