aspose file tools
The moose likes Other JSE/JEE APIs and the fly likes How to get the Dates in-between two Dates Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "How to get the Dates in-between two Dates" Watch "How to get the Dates in-between two Dates" New topic
Author

How to get the Dates in-between two Dates

Anamika Gubba
Greenhorn

Joined: May 15, 2006
Posts: 9
Hi,

I am struggling to calculate the dates in between two Dates. Can any one tell me how to do this?

For Example say

Date toDate = 2006-05-20
Date fromDate = 2006-05-25

I want to calculate in-between days. I.e. I want to get the result as

2006-05-21
2006-05-22
2006-05-23
2006-05-24
2006-05-25

Please let me know how to do this.

Thanks in advance,
Anamika
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Here's one way:

toDate = 2006-05-20
fromDate = 2006-05-25

add 1 day to toDate

while toDate is less than or equal to fromDate

print toDate

add 1 day to toDate

loop
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the Dates in-between two Dates
 
Similar Threads
days between two dates
Calculating weekday and weekend dates..Urgent
Stumped By HashSet
Displaying tha Date between two dates in paint method...
how to covert string to date object?.