This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One more GregorianCalendar question

 
James Brooks
Gunslinger
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My book wants me to write an app to calculate the number of days from now until the end of the year. I came up with the below, but it displays 0. If I leave the GregorianCalendar constructor blank, it initializes to the current date, right? What am I doing wrong? Thanks!

-Patrick

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now.get(GregorianCalendar.DAY_OF_YEAR)
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for more detail:

 
James Brooks
Gunslinger
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, guess I was missing the get().

-Patrick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic