The FORMAT function return wrong value with the date of the latest 2 days of the year (December 31 or December 30, any year) and the pattern 'kDateFormat_Pattern' : for the year 2019, the returned year is 2020 but it should be 2019.
(Perhaps the bug is in the icu library ?)
To reproduce,
- Open VStudio (any version, included the newest 9.8.2)
- Set date format to DDMMYYYY and "/" as delimiter
- type in the SQL pane :
SELECT YEAR(GETDATE('31/12/2019')) GoodYear, FORMAT(GETDATE('31/12/2019'), 'YYYY-MM-dd', 'kDateFormat_Pattern') BadFormatedDate
The result show : 2019 | 2020-12-31
Reported in Mantis (#0008716).