Problem with calendar

E

Erwin

i have a problem with calendar, and throws a exception called

java.lang.IllegalArgumentException: MONTH

Im getting the actual date and the two passed months with calendar

Does anybody know what it means that??
 
F

Fred

i have a problem with calendar, and throws a exception called

java.lang.IllegalArgumentException: MONTH

Im getting the actual date and the two passed months with calendar

Does anybody know what it means that??

Showing a little bit of your code would certainly help.
 
R

Roedy Green

i have a problem with calendar, and throws a exception called

java.lang.IllegalArgumentException: MONTH

Im getting the actual date and the two passed months with calendar

Does anybody know what it means that??

What method is causing the exception? what values are you passing to
it?

Note that in GregorianCalendar, January is month 0. In contrast, in
DateFormat, January is month 1.
 
A

Arne Vajhøj

What method is causing the exception? what values are you passing to
it?

Note that in GregorianCalendar, January is month 0. In contrast, in
DateFormat, January is month 1.

The constant Calendar.JANUARY has a numeric value of 0.

If people use the API as intended, then the numeric
values does not matter - it is just an opaque indication of
a specific month.

To say that January is "month 0" is using the API the
wrong way.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top