Page 1 of 1
About Question enthuware.ocpjp.v8.2.2017 :
Posted: Sat Dec 15, 2018 7:36 am
by ramon.carrascom
Hi,
Are OffsetDateTime and ZoneOffset in the scope of this exam?
Thank you
Re: About Question enthuware.ocpjp.v8.2.2017 :
Posted: Sat Dec 15, 2018 8:24 am
by admin
Officially, they are not but we have heard reports of a few candidates seeing them in the exam.
Re: About Question enthuware.ocpjp.v8.2.2017 :
Posted: Sat Mar 23, 2019 3:51 pm
by floryan
I don't quite understand why the correct answer is "PT-1H" and not "PT1H".
The OffsetDateTime is "2017-06-02T06:00-05:00" and the ZonedDateTime is "2017-06-02T06:00-04:00".
I thought in order to calculate Duration.between, one has to count the time it takes to "get from the first to the second". If I want to go from -5 to -4 then I'd add +1. Or in other words, if clocks are one hour ahead due to summer time e.g. 2am instead of 1am, it seems more logical to me to add +1 to get from 1am to 2am.
EDIT: found an explanation here ->
viewtopic.php?f=2&t=4237
Re: About Question enthuware.ocpjp.v8.2.2017 :
Posted: Tue Aug 20, 2019 3:57 pm
by lukacsa82
Duration.between(date1, date2) does subtraction. In this case it means date1-date2 which is -5-(-4) = -5+4 = -1
Re: About Question enthuware.ocpjp.v8.2.2017 :
Posted: Tue Aug 20, 2019 11:12 pm
by admin
Yes, that makes sense too.