YYYY vs yyyyIssue In Java, there is a subtle difference between "YYYY" and "yyyy" when used in the formatting string for a script that handles date variables. YYYY represents "Year of the week" yyyy represents the year value in the date (ie this year for "now()"). Year of the week means for the last week of the year, if the last day of the week falls in the next year, then this will return the next year instead of the current year. For example: var valiDate = new GlideDate(); valiDate.setValue("2021-12-31"); gs.print("Expected: " + valiDate.getByFormat("yyyy-MM-dd") + " - Probably unexpected: " + valiDate.getByFormat("YYYY-MM-dd")); Output: *** Script: Expected: 2021-12-31 - Probably unexpected: 2022-12-31