← Quiz: Date and Time in Java: all 10 questions
Quiz: Date and Time in Java · Question 2 of 10
In LocalDate.of(2026, 1, 15), which month is it?
In LocalDate.of(2026, 1, 15), which month is it?
- A.February, because months start at 0
- B.December
- C.January
- D.It depends on the computer's locale
Answer & explanation
Correct answer: January
In java.time, months are numbered 1 to 12, unlike the old Calendar class.
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 →