How to check a DateTime is an occurence of recurring event using Joda Time?

前端 未结 2 1234
萌比男神i
萌比男神i 2021-01-23 12:26

I\'ve a DateTime that represent the beginning of a recurring event. A Days (daily period) will represent the recurring period. I assume that this rec

2条回答
  •  青春惊慌失措
    2021-01-23 13:05

    You can always use the add method in the Calendar class.

    You could do the following -

    Date date = "2013-06-27" ; 
    Calendar cal = Calendar.getInstance();  
    cal.setTime(date);  
    cal.add(Calendar.DATE, 3); // add 3 days  
    date = cal.getTime();  
    

    And so on...

提交回复
热议问题