Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get next month of current month is there any API for that [closed]

Tags:

android

Suppose todays date 06-25 then how can I get 07-25(or how can I compare with 07-25).

Thank you.

like image 340
Amar007 Avatar asked Dec 12 '25 22:12

Amar007


1 Answers

use this Method this is simple

just add one month to current date,

public static Date getCurrentDatePlusMonth(int month)
    {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.add(Calendar.MONTH, month);
        Date newDate = calendar.getTime();
        return newDate;
    }
like image 108
Dixit Patel Avatar answered Dec 16 '25 23:12

Dixit Patel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!