-1

Can anyone tell me the best way of calculating the end date of a recurring event from the number of occurrences .

For example: I have an event which has start date as 30/09/2021 (Thursday) and occurs every week days. This event will end after 12 occurrences. How can i calculate the enddate using java,pleasee provide some examples,Thankyou.

Teja sree
  • 1
  • 2
  • you can add 12 moths in the given date to calculate end date. for more detils https://stackoverflow.com/questions/1555262/calculating-the-difference-between-two-java-date-instances – Sujit Sharma Sep 30 '21 at 11:36
  • provide a Minimal, Complete, and Verifiable example. Show the code for your latest attempt and where you got stuck. – Eritrean Sep 30 '21 at 12:07

1 Answers1

1

Add the number of weeks * 7 days to the date.

For example, If the date is today and we need to find the date after 12 weeks

LocalDate.now().plusDays(12 * 7) // 12 *7 days

Ajit Kumar
  • 181
  • 3