Sam Thompson wrote:At the same time I am looking through the Javadocs right now and I don't see anything that can give me directly what I need. All I see are methods and objects that will only give you field value information.
Sam Thompson wrote:However, the month it gives me is 8, and not 9- since we are now in September.
Is there a way to fix it with another method?
Or should I have to add one to the month value every time this program is used?
Sam Thompson wrote:In this case though I am going to have to add one to it because I want it to show the correct date in the filename whenever I use the generated or save data for later analysis.
I get what you are saying. It's just like with how arrays and lists are indexed right? The very first index is always ZERO. (DUH! Hand smacks head!) I should've known.
James Boswell wrote:
I get what you are saying. It's just like with how arrays and lists are indexed right? The very first index is always ZERO. (DUH! Hand smacks head!) I should've known.
Actually, you shouldn't have. The fact that January is 0 and December is 11 is not a particularly nice feature of the Calendar class.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Did you really? I obviously didn’t look at the thread properly on Tuesday, otherwise I would have noticed the three really bad bits of style in that code.Sam Thompson wrote: . . .
. . .
Don't get me started about those stupid light bulbs. |