wood burning stoves 2.0*
The moose likes Java in General and the fly likes Iterating Through Dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Iterating Through Dates" Watch "Iterating Through Dates" New topic
Author

Iterating Through Dates

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1478
    
    1
If I have a begining date and and ending date how do I iterate through them getting a value for each month?
Bill Cruise
Ranch Hand

Joined: Jun 01, 2007
Posts: 148
As I hinted at in your other post, make a Calendar object for both dates. Add one to the day field of the start date until it reaches the end date.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1478
    
    1
Thanks. I got it to work as you said.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42612
    
  65
This thread has a great subject line, so I was kind of disappointed to read about calendars and stuff.


Ping & DNS - my free Android networking tools app
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671


"I'm not back." - Bill Harding, Twister
Bill Cruise
Ranch Hand

Joined: Jun 01, 2007
Posts: 148
Ulf, I'm not sure what it says about me that I had to read your post 3 times before I got the joke. I guess my mindset is extremely dependent on what internet forum I'm reading.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterating Through Dates