My Oracle Support Banner

[Java SE] YYYY vs yyyy in Java Date Formatting (Doc ID 3066357.1)

Last updated on MARCH 05, 2025

Applies to:

Java SE JDK and JRE - Version 7 and later
Information in this document applies to any platform.

Symptoms

When formatting dates in a Java application, improper use of 'YYYY' can lead to significant issues.

For example, when using the 'YYYY' format, December 30, 2024, is incorrectly represented as 2025-12-30.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.