• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java 17 OCP Study Guide: Time Comparison Confusion

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the Java 17 OCP Study Guide, on page 194 (according to Kindle), we’re given two ZonedDateTime to GMT conversions:

2022–06–20T06:50+05:30[Asia/Kolkata]    // GMT 2022–06–20 01:20
2022–06–20T07:50-05:00[US/Eastern]      // GMT 2022–06–20 12:50


Then it says:

After converting to GMT, you can see that the U.S. Eastern time is 11 and a half hours behind the Kolkata time.


I’m new to timezones, so forgive me if this is a stupid question, but how is the U.S. Eastern time behind the Kolkata time? Isn’t 2022–06–20 12:50 11 and a half hours ahead of 2022–06–20 01:20?
 
Greenhorn
Posts: 25
3
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hugo,
I took me a while to understand it as well, and I think it's just a language misunderstanding.
In my language when a moment is behind another it means it's before the other.
In english "behind" means after.
 
Marshal
Posts: 28134
94
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where I live it's now just after 3 pm. Where my sister lives, three time zones east, it's now just after 6 pm. So her time is after, or ahead of, my time. I asked my wife (a native English speaker like me) what preposition she would use and that was her answer. Which I agree with. 6 pm is after 3 pm.

However the question you're commenting on is different. If you take my time and my sister's time and convert them both to GMT, then of course you get the same time in GMT for both. They are both the same time, we just have different names for them based on the time zone we live in.

In your question we start with 06:50 [Kolkata] and 07:50 [Eastern]. Superficially Eastern is one hour later than (after) Kolkata but they don't represent the same moment in time so that isn't a meaningful comparison. When you convert them both to GMT you get 01:20 for Kolkata and 12:50 for Eastern. (On the same day, which is important.) So from that viewpoint, Eastern is after Kolkata and Kolkata is before Eastern.

But what about "behind"? Marco says it means "after" in English. Which it does, if you're racing 1500 meters on the track. If you finish behind Jakob then you finished after him. But if my watch says 3:10 pm and my wife's watch says 3:15 pm then we would say my watch is behind hers. That's because the time on mine is before the time on hers. So here it means "before" in English.

In other words you have to decide which of those two contexts is represented by the question. The question is about comparing two instants of time, which sure sounds like the latter, i.e. behind == before. But Hugo is confused and to me using "behind" in this question smells bad. If it were me I would use "before" or "after" for clarity.
 
Hugo Javadi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much, Marco and Paul - I appreciate you taking the time to help clear my doubts. English is fun sometimes!
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic