Get 1 month ago from current datetime

Viewed 9995

I'm trying to get 1 month ago date and time but what i get from this was 2013 11 02 which the correct one should be 2013 12 02 pls help.

My Code as below :-

Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MONTH, -1);

    int thisYear = calendar.get(Calendar.YEAR);
    int thisMonth = calendar.get(Calendar.MONTH);
    int thisDay = calendar.get(Calendar.DAY_OF_MONTH);
2 Answers
Related