GlideDateTime - getYearLocalTime()

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

Table 1. Parameters
Name Type Description
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

Output: 2011