← Quiz: Date and Time in Java: all 10 questions
Quiz: Date and Time in Java · Question 8 of 10
Why might a date formatted with "YYYY" show the wrong year in late December?
Why might a date formatted with "YYYY" show the wrong year in late December?
- A.YYYY is not a valid pattern
- B.YYYY is the week-based year, which can already be the next year in the last days of December
- C.YYYY always prints two digits
- D.YYYY uses the Hindu calendar
Answer & explanation
Correct answer: YYYY is the week-based year, which can already be the next year in the last days of December
Use lowercase yyyy for the normal calendar year.
Can you get the rest right without peeking?
Take the timed Quiz: Date and Time in Java quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →