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)?
About Question enthuware.ocpjp.v8.2.1748 :
Moderator: admin
-
- Posts: 9
- Joined: Wed Dec 28, 2016 12:35 pm
- Contact:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1748 :
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 207 guests