Incrementing a java.util.Date by one day

前端 未结 8 1041

What is the correct way to increment a java.util.Date by one day.

I\'m thinking something like

        Calendar cal = Calendar.getInstance();
        ca         


        
8条回答
  •  情话喂你
    2021-02-07 02:00

    If Java 8 or Joda Time are not an option, you could always opt for Apache DateUtils:

    DateUtils.addDays(myDate, 1);
    

提交回复
热议问题