About Question enthuware.ocpjp.v8.2.1748 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Tanooki
Posts: 9
Joined: Wed Dec 28, 2016 12:35 pm
Contact:

About Question enthuware.ocpjp.v8.2.1748 :

Post by Tanooki »

Why is the answer 9:00 & 10:00?

I don't see the Period.ofDays() adding 24 hours instead of 23?

In the US/Eastern timezone it will be 9:00 am in the morning 1 day later, since there is a shift because of DST at 2 AM in the morning on the 1st of november.

So why is plus'ing a Duration.ofDays(1) different from plus'ing a Period.ofDays(1)?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1748 :

Post by admin »

There is a conceptual difference between the two - A Duration measures an amount of time using time-based values (seconds, nanoseconds). A Period uses date-based values (years, months, days).
When you add Period, you are increasing the date and not bothered about the time passed to reach that date. When you add Duration, you are adding time, the date so arrived at is secondary.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 207 guests