Is it possible in java to get all dates between two dates
Can any one help me please..
You can take the input- Start date and end date. So from Start date onwards- Keep adding 1 day to the date till the date is less than your end date. You can use- the add() method in the Calendar class.
Nisha Kala wrote:I tried add function.. am not able to it..
I got dates as a list of String..
You have to be careful with the format of the dates. It will be easier if you have your startDate and endDate in java.util.Date and not in String. Otherwise you can use SimpleDateFormat and a correct pattern to convert them to Date instances. Once you have the Start and End dates in Date format. The next step would be: