About Question enthuware.ocpjp.v8.2.2017 :

Moderator: admin

Post Reply
ramon.carrascom
Posts: 19
Joined: Sun Aug 27, 2017 12:35 pm
Contact:

About Question enthuware.ocpjp.v8.2.2017 :

Post by ramon.carrascom » Sat Dec 15, 2018 7:36 am

Hi,

Are OffsetDateTime and ZoneOffset in the scope of this exam?

Thank you

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

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

Post by admin » Sat Dec 15, 2018 8:24 am

Officially, they are not but we have heard reports of a few candidates seeing them in the exam.
If you like our products and services, please help us by posting your review here.

floryan
Posts: 8
Joined: Sun Sep 23, 2018 4:10 am
Contact:

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

Post by floryan » Sat Mar 23, 2019 3:51 pm

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

lukacsa82
Posts: 1
Joined: Mon Aug 19, 2019 6:02 pm
Contact:

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

Post by lukacsa82 » Tue Aug 20, 2019 3:57 pm

Duration.between(date1, date2) does subtraction. In this case it means date1-date2 which is -5-(-4) = -5+4 = -1

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

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

Post by admin » Tue Aug 20, 2019 11:12 pm

Yes, that makes sense too.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest