Page 1 of 1

About Question enthuware.ocpjp.v17.2.3789 :

Posted: Mon Nov 18, 2024 2:33 am
by rlobato
Whatever is the time is currently in NY, the same time happens 3 hours later in LA.
Isn't it the other way around? "Given that New York is 3 hours ahead of Los Angeles"

Cheers

Re: About Question enthuware.ocpjp.v17.2.3789 :

Posted: Mon Nov 18, 2024 5:44 am
by admin
No. It is correct. NY is ahead, which means, LA is later. So, if it is 9AM in NY now, then the clock will sound 9AM in LA three hours from now.

Re: About Question enthuware.ocpjp.v17.2.3789 :

Posted: Sun Feb 23, 2025 4:40 am
by raphaelzintec
i really dont understand how Ny is 3 hours ahead LA but for duration.between LA is higher....

it's like black and white, 1+1=2, NY > LA by 3 hours, but LA bigger...

Re: About Question enthuware.ocpjp.v17.2.3789 :

Posted: Sun Feb 23, 2025 5:23 am
by admin
LA is not "bigger". As the explanation says, Duration.between method can be a negative period if the end is before the start. To find the duration.between, you need to get both the first argument and second argument at the same base line. let's say our base line is NY time. So, 6AM in LA is actually 9 AM in NY. Thus, the second argument (9AM) is NOT before the first argument (6AM). Therefore, the difference will be positive 3 Hours.

Re: About Question enthuware.ocpjp.v17.2.3789 :

Posted: Mon Feb 24, 2025 7:07 pm
by raphaelzintec
thank you for the explanation

now i understand better with "before" term instead of "smaller/bigger"

NY is before LA with 3 hours ahead so LA is behind and NY is first param so positive

very easy now thank you