dateutil.relativedelta.WE and friends?

Skip Montanaro skip at pobox.com
Mon Nov 11 15:33:09 EST 2013


I found a rather inscrutable use of dateutil recurrence rules in
StackOverflow which generates a series of dates corresponding to the
third Wednesday of the  month:

    import dateutil.rrule as dr
    import dateutil.relativedelta as drel

    dt = datetime.datetime(2012, 1, 1, 0, 0)
    rule = dr.rrule(dr.MONTHLY, byweekday=drel.WE(3), dtstart=dt, count=12)



More information about the Python-list mailing list