Working with Calendar object in Groovy

James McMahon <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAEqJCe0LZKO_5RGucGnCwLzgwpYaNFnc9hFT4w8P-hGr-HZX+A@mail.gmail.com>
If I have a Calendar object created for 1999-01-01, a get() of
calendar.MONTH will return 0. From references I’ve found through Google, we
have to add 1 to MONTH to get the 1 for January. The calendar object has 0
for MONTH.

Now let’s take the case where we set our calendar object from “1999”,. When
we get MONTH it is also 0 - but not because our month was January, but
because it was not present.

How does the calendar instance differentiate between those two cases? Is
there another calendar object element that tells me “hey, I could set no
day or month from a date like 1999”?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.