Inspectopedia Help

Week Based Year

Week Based Year

The DateTimeFormatter pattern YYYY returns the week based year, not the era-based year. This means that 12/29/2019 will format to 2019, but 12/30/2019 will format to 2020!

If you expected this to format as 2019, you should use the pattern yyyy instead.

Issue id: WeekBasedYear

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3


Android, 2022.3.1 Beta 2

Last modified: 13 July 2023