File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes One more GregorianCalendar question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "One more GregorianCalendar question" Watch "One more GregorianCalendar question" New topic
Author

One more GregorianCalendar question

James Brooks
Gunslinger
Ranch Hand

Joined: Aug 17, 2006
Posts: 165
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



Hello. My name is Inigo Montoya. You killed my father. Prepare to die.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
now.get(GregorianCalendar.DAY_OF_YEAR)
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
for more detail:

James Brooks
Gunslinger
Ranch Hand

Joined: Aug 17, 2006
Posts: 165
Thanks, guess I was missing the get().

-Patrick
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: One more GregorianCalendar question