1Z0-829 Practice Question: Handling Date, Time, Text, Numeric and Boolean Values
Given: ZonedDateTime zdt = ZonedDateTime.of(2024, 3, 10, 2, 30, 0, 0, ZoneId.of("America/New_York")); In the US, on March 10, 2024, clocks spring forward at 2:00 AM to 3:00 AM. What is the output of System.out.println(zdt);?
⚠ Common exam trap
Watch out — candidates often assume an invalid local time (like 2:30 AM during a spring-forward) will throw an exception or be stored as-is with the pre-gap offset, but Java silently adjusts the time forward to the next valid offset, changing both the time and the offset.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
2024-03-10T03:30-04:00[America/New_York]
When a ZonedDateTime is created for a time that falls within a DST gap (2:00 AM to 3:00 AM on March 10, 2024, in America/New_York), the Java API automatically adjusts the time forward to the next valid offset. The local time 2:30 AM does not exist because clocks spring forward to 3:00 AM, so the ZonedDateTime is normalized to 3:30 AM with the DST offset -04:00. This behavior is defined by the ZonedDateTime.of method, which resolves invalid local times by shifting to the offset after the gap.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Throws DateTimeException
Why it's wrong here
Incorrect: ZonedDateTime.of does not throw an exception; it adjusts the time.
- ✗
2024-03-10T02:30-05:00[America/New_York]
Why it's wrong here
Incorrect: This represents EST, but at 2:30 AM the time does not exist; Java automatically adjusts.
- ✗
2024-03-10T02:30-04:00[America/New_York]
Why it's wrong here
Incorrect: The offset -04:00 indicates EDT, but the time 2:30 does not exist on that date; Java does not preserve the time with the EDT offset.
- ✓
2024-03-10T03:30-04:00[America/New_York]
Why this is correct
Correct: Java adjusts to the valid time 3:30 AM EDT (offset -04:00).
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.