simple module to manipulate recurring dates

Skip Montanaro
Sat, 07 Aug 99 01:03:40 GMT

In Musi-Cal I frequently need to deal with recurring dates such as "every
Monday from 1pm to 3pm".  The fact that I can't easily process recurring
dates has been an ongoing problem.  After one of my partners posed a
question about recurring dates for another project a couple days ago, I
decided it was time to start thinking seriously about it.  The result is a
small module,, which you can get to through my Python Bits page at

The module implements a single class, Recurrence.  You can intersect two
recurrences to get a new one or generate a finite series of absolute dates
from an infinite recurrence.  It doesn't yet do unions (my feeble brain
hasn't figured that out), nor can it parse limited English phrases such as
the one above into a Recurrence object.  Also, it can only represent simple
recurrences.  More complex recurrences like "Easter", "every other Friday"
or "the third Thursday of the month" are beyond it.

Marc-Andre Lemburg's mxDateTime module:

is required.

I'd very much like to get some feedback on this, especially on the stuff it
can't do.  It's an area where I have virtually no past programming
experience (literature references would be most welcome!).  If I'm hiking
down the wrong trail I'd like to find out before I run into a lot of grizzly
bears (or even the occasional snake... ;-)


Skip Montanaro	|  |

<P><A HREF=""></A> -
a Python class to handle recurring dates; needs mxDateTime
module.  (06-Aug-99)

----------- comp.lang.python.announce (moderated) ----------
Article Submission Address:
Python Language Home Page:
Python Quick Help Index: