1Z0-829 · Question #33
Daylight Saving Time (DST) is the practice of advancing clocks at the start of spring by one hour and adjusting them backward by one hour in autumn. Considering that in 2021, DST in Chicago…
The correct answer is A. true false. On DST's end day in Chicago, clocks "fall back" at 2:00 AM - meaning 1:30 AM CDT (UTC-5) + 1 hour = 1:30 AM CST (UTC-6), not 2:30 AM. Both zdt.getHour() and anHourLater.getHour() return 1, so the hour comparison prints true; however, the two ZonedDateTime objects are not equal…
Question
Options
- Atrue false
- Bfalse true
- Ctrue true
- Dfalse false
- Etrue null
How the community answered
(28 responses)- A57% (16)
- B11% (3)
- C4% (1)
- D4% (1)
- E25% (7)
Explanation
On DST's end day in Chicago, clocks "fall back" at 2:00 AM - meaning 1:30 AM CDT (UTC-5) + 1 hour = 1:30 AM CST (UTC-6), not 2:30 AM. Both zdt.getHour() and anHourLater.getHour() return 1, so the hour comparison prints true; however, the two ZonedDateTime objects are not equal because they represent different instants (different UTC offsets: -05:00 vs -06:00), so the equals() comparison prints false - giving output A.
Why the distractors fail:
- B (false/true): The hour values are the same (both
1), so the first line can't befalse; andequals()can't betruewhen the offsets differ. - C (true/true):
equals()compares both local time and offset, so twoZonedDateTimes at 1:30 AM with different offsets are never equal. - D (false/false): Both lines are wrong - the hour comparison is
true, notfalse. - E (true/null):
plusHours()always returns a validZonedDateTime; it never producesnull.
Memory tip: Think "Fall Back = same digit, new offset." On a fall-back night, adding one clock-hour lands you on the same local hour in the new timezone offset, so getHour() matches - but the timestamps are different instants, so equals() still fails.
Topics
Community Discussion
No community discussion yet for this question.