View Single Post
Old 07-26-2004, 10:41 AM   #8 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,175
Belisarius is on a distinguished road
c.MONTH is a static int that represents the value MONTH, not the current month. It's used by the get() method.

Try this:
Code:
  Calendar c = Calendar.getInstance();
  java.util.Date dt = new java.util.Date();

  c.setTime(dt);
  out.println(c.get(c.MONTH));
You could actually reduce this to:
Code:
  Calendar c = Calendar.getInstance();
  out.println(c.get(c.MONTH));
__________________
GitS
Belisarius is offline   Reply With Quote