What is the best practice to iterate through a start and end date?
+2
A:
I once used a variant of the following Date Iterator.
Not sure if it is a best practice or not, but it was a clear solution and I liked it.
dpb
2010-06-24 11:33:29
A:
Iterator myVeryOwnIterator = HashMap.keySet().iterator(); while(myVeryOwnIterator.hasNext()) { System.out.println(myVeryOwnIterator.next()); }
salyutan
2010-06-24 12:42:22
A:
If you want to iterate between certain time units such as every hour between two dates, you could take a look at this obligatory joda-time answer: Java date iterator factory, with rules specifying how to calculate the intervals
Esko
2010-06-24 12:45:15