Building a list of dates between two dates
How about...

def date_count(start, end, day_of_month=1):
    dates = [start]
    next_date = start.replace(day=day_of_month)
    if day_of_month &gt; start.day:
        dates.append(next_date)
    while next_date &lt; end.replace(day=day_of_month):
        next_date += relativedelta(next_date, months=+1)
        dates.append(next_date)
    return dates


And by the way it seems like a nice opportunity to use yield, if you wanted to.

def date_count2(start, end, day_of_month=1):
    yield start
    next_date = start.replace(day=day_of_month)
    if day_of_month &gt; start.day:
        yield next_date
    while next_date &lt; end.replace(day=day_of_month):
        next_date += relativedelta(next_date, months=+1)
        yield next_date


Another possibility - discard the first value if it is earlier than the start date:

def date_count(start, end, day_of_month=1):
    dates = [start.replace(day=day_of_month)]
    while dates[-1] &lt; end.replace(day=day_of_month):
        dates.append(dates[-1] + relativedelta(dates[-1], months=+1))
    if dates[0] &gt; start:
        return [start] + dates
    else:
        return [start] + dates[1:]


Or use a list comprehension to iterate over the number of months between start and end.

def date_count(start, end, day_of_month=1):
    round_start = start.replace(day=day_of_month)
    gap = end.year * 12 + end.month - start.year * 12 - start.month + 1
    return [start] + [round_start + relativedelta(round_start, months=i) 
                      for i in range(day_of_month &lt;= start.day, gap)]


Finally, I don't know dateutil but it seems you can use rrule:

from dateutil import rrule
def date_count(start, end, day_of_month=1):
    yield start
    for date in rrule(MONTHLY, 
                      dtstart=start.replace(day=day_of_month),
                      until=end.replace(day=day_of_month)):
        if date &gt; start:
            yield date