• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

OCPJP Chapter 5: Errata about the end of DST

 
Ranch Hand
Posts: 50
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From p.252, in the first paragraph:

When we change our clocks in November, time falls back and we experience the hour from 2:00 a.m. to 2:59 a.m. Children learn this as spring forward in the spring and fall back in the fall



First of all, I'm in Europe, we also change the hour back in the fall except we do it in October. We change it from 3:00 AM to 2:00 AM. Apparently in the states its the same, you change the hour 1h back, so the text should say from 2:59 to 2:00.

I actually looked at what happened in New York in 2016 and apparently on November the 5th you went from 2:00 AM to 1:00 AM.

Extra clarification is needed on question 14, because on the end of DST day there are 2 possible 2:15 hours: the one which has the old offset, and the one with the new offset. Creating a LocalTime.of(2,15) for that day is ambiguous, and Java isn't "smart enough to adjust for DST" as per the answer in p.559, but rather has to pick one and defaults to the no DST one (the latter). In spring however we could talk of a "correction" since the conflictive hour doesn't really exist.
 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
First of all, I'd like to say that I wish the exam didn't require people to know how the US does daylight savings time. I gave this feedback on the beta, but alas...

John Schubert wrote:From p.252, in the first paragraph:

When we change our clocks in November, time falls back and we experience the hour from 2:00 a.m. to 2:59 a.m. Children learn this as spring forward in the spring and fall back in the fall



You found an errata. This is wrong. We experience 1-1:59am twice. The diagram on page 251 has it correct. I just added this to the errata and credited you.

John Schubert wrote:First of all, I'm in Europe, we also change the hour back in the fall except we do it in October. We change it from 3:00 AM to 2:00 AM. Apparently in the states its the same, you change the hour 1h back, so the text should say from 2:59 to 2:00.


Interesting. Probably because I don't have to memorize the rules in Europe for a test . What country is that for? Or does all of Europe do that?

John Schubert wrote:I actually looked at what happened in New York in 2016 and apparently on November the 5th you went from 2:00 AM to 1:00 AM.


Correct.

John Schubert wrote:Extra clarification is needed on question 14, because on the end of DST day there are 2 possible 2:15 hours: the one which has the old offset, and the one with the new offset. Creating a LocalTime.of(2,15) for that day is ambiguous, and Java isn't "smart enough to adjust for DST" as per the answer in p.559, but rather has to pick one and defaults to the no DST one (the latter). In spring however we could talk of a "correction" since the conflictive hour doesn't really exist.


Per the above, the question is fine. There's two 1:15 am's but only one 2:15 am.

Fun fact: editors care greatly about the format of "a. m.". I don't so I am not consistent in this post .
 
John Schubert
Ranch Hand
Posts: 50
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:
You found an errata. This is wrong. We experience 1-1:59am twice. The diagram on page 251 has it correct. I just added this to the errata and credited you.



Thanks for your response. Glad I made it into the errata, but that was not what I meant. I think there might be now an errata in the errata! In the errata it says the text should say “1:00 a.m. – 1:59 a.m.”, but that sentence is not talking about the intervals in the figure 5.2, but rather it is explaining how the time change goes. The change is going from 1:59 am to 1:00 am (thus the fall back rule, be are adjusting our clocks 1h back). My point is, I don't care at which time change takes place: the important part here is that it consists in going back 1h and the book is saying the complete opposite. That the actual change time in the US happens at 1:59 instead of 2:59 as you spotted is another errata I didn't notice, but it is not as important as my intended errata because the changeover time is different in each country/jurisdiction but the falling back in fall is universal for every country adhering to DST).

It clearly says so in Wikipedia: DST - Procedure

So the corrected first paragraph should say:
"When we change our clocks in November, time falls back from 1:59 a.m. to 1:00 a.m"

This sentence clearly shows the time has gone back 1h and is also symmetric with the sentence describing the March changeover in the previous page, which was correct:
"When we change our clocks in March, time springs forward from 1:59 a.m. to 3:00 a.m."

Actually the diagram in p.251 is also wrong as it goes from the second 1:00 am - 1:59 am interval to 2:00 am - 4:00 am. This last interval spans two hours. It should say 2:00 am - 3:00 am.
 
Jeanne Boyarsky
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Schubert wrote: That the actual change time in the US happens at 1:59 instead of 2:59 as you spotted is another errata I didn't notice, but it is not as important as my intended errata because the changeover time is different in each country/jurisdiction but the falling back in fall is universal for every country adhering to DST).


I'm still giving you credit for the other errata as you got me looking at it .

John Schubert wrote:Thanks for your response. Glad I made it into the errata, but that was not what I meant. I think there might be now an errata in the errata! In the errata it says the text should say “1:00 a.m. – 1:59 a.m.”, but that sentence is not talking about the intervals in the figure 5.2, but rather it is explaining how the time change goes. The change is going from 1:59 am to 1:00 am (thus the fall back rule, be are adjusting our clocks 1h back). My point is, I don't care at which time change takes place: the important part here is that it consists in going back 1h and the book is saying the complete opposite.


I'm not catching the distinction. I have "time falls back and we experience the hour from 1:00am to 1:59am" and you are prosing "time falls back from 1:59am to 1:00am". Both say that time falls back. Both say that it is 1am after time falls back. These sound equivalent to me. What am I missing here?

John Schubert wrote:Actually the diagram in p.251 is also wrong as it goes from the second 1:00 am - 1:59 am interval to 2:00 am - 4:00 am. This last interval spans two hours. It should say 2:00 am - 3:00 am.


The diagram is correct. Those boxes do not represent hours Each row is showing what happens between 1am and 4am. The idea is to show time carries on as normal after 2am.

You clearly understand it well enough from the exam from the fact that you can discuss it here! So yay!
 
John Schubert
Ranch Hand
Posts: 50
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:
I'm not catching the distinction. I have "time falls back and we experience the hour from 1:00am to 1:59am" and you are prosing "time falls back from 1:59am to 1:00am". Both say that time falls back. Both say that it is 1am after time falls back. These sound equivalent to me. What am I missing here?



Thanks again for your patience. I now get that the book is talking about the intervals instead of describing the changeover procedure, as it did with the spring one (the book does a really good job there, there is no possible confusion IMHO).

Now for the missing part. Your sentence makes little sense to me because:

Jeanne Boyarsky wrote:
"time falls back..."


Yeah but at what time? You need to go two paragraphs back in the text to find out the time:
"We officially change our clocks at 2 a.m, ..."

And the last (corrected) part:

Jeanne Boyarsky wrote:
"... and we experience the hour from 1:00am to 1:59am"


We experience that interval every day! This part is the most confusing because I was reading it as:
"we experience the hour [going back] from 1:00am to 1:59am"

This is what I now think you are trying to convey:
"time falls back [at 2:00 am] and we experience the hour from 1:00am to 1:59am [again]"

But for me as a first reader there is so much left to interpretation, I'd have appreciated the changeover to have been explicitly described, and then if you wish mention the repeating interval.

I've a final consideration about the last paragraph in this section:
"it is annoying that Oracle expects you to know this even if you aren't in the United States"
Actually DST is a very important topic for every Java programmer, just as much as i18n. Just look at the number of coloured countries in Wikipedia's map:


As a Java programmer chances are that you need to work for an international customer at some point in your career, so one needs to have this in mind. The only part that is US-specific in the exam are the spring and fall changeover times, but the exam creators probably cannot provide a different question tailor-made for each country. There is no need to, because we can abstract the mechanism and apply it to any country just by changing the changeover time, which the exam will probably tell you anyway:
* We change time forward 1h in spring, and so there is a missing interval.
* We change time backwards 1h in fall, and so there is a repeating interval
* The offset relative to GMT changes
* The specific changeover time varies for each country and it doesn't even have to be the same in spring and fall (e.g. in the Brussels timezone, comprising several countries, its 2:00 am in spring and 3:00 am in the fall)
Notice that spring doesn't even mean March, as in the southern hemisphere they do the spring changeover in November and the fall one in March  

 
Jeanne Boyarsky
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gotcha. I'll add it to our private list of things that could be clearer in the next edition.

For what it's worth, I don't object to the topic of DST. I object to Oracle requiring people to know the spring forward/fall back/2am part. As you noted, that varies by country. I would have preferred they provide that information as a "given".
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic