A code snippet to set a Date object to the last date of the month:
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
System.out.println(cal.getTime());
The Calendar API has a lot of other utility methods that are very convenient when you need to work on dates.
Tuesday, August 30, 2011
Subscribe to:
Posts (Atom)