Possible duplicate:
How to get the first date and last date of the previous month? (Java)
In java, how to get the first and last date of the previous month?
If I am not mistaken, the following code should receive the last date of the previous month.
Calendar aCalendar = Calendar.getInstance(); aCalendar.set(Calendar.DAY_OF_MONTH, -1); aCalendar.add(Calendar.DAY_OF_MONTH, -1) ; System.out.println(new Timestamp(aCalendar.getTime().getTime()));
Correct me if I am wrong.
Thanks.
java date datetime calendar
user915303
source share