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

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top