18
I think the "best" way to do that depends a lot on what you're doing between these two days.
In many cases, a simple for (0..31) loop will suffice.
In other cases, you may wish to use an epoch value, and add/subtract 86400 seconds on each itteration.
In one application I've written, I do exactly this, using a DateTime object that I add one day to for each iteration. This is likely overkill for many applications, though.