GlideDateTime - getWeekOfYearUTC()

Gets the number of the week stored by the GlideDateTime object, expressed in the UTC time zone.

All weeks begin on Sunday. The first week of the year is the week that contains at least one day of the new year. The week beginning Sunday 2015-12-27 is considered the first week of 2016 as that week contains January 1 and 2.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Number The number of the current week in UTC time. The highest week number in a year is either 52 or 53.

Scoped equivalent

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

var gdt = new GlideDateTime("2011-12-01 12:00:00");
gs.print(gdt.getWeekOfYearUTC());

Output: 49