dateutil.relativedelta.WE and friends?

S

Skip Montanaro

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,614
Members
45,290
Latest member
JennaNies

Latest Threads

Top