calendar (date) iterator?

Marcus magoldfish at gmail.com
Tue Mar 6 23:19:21 CET 2007


On Mar 6, 3:19 pm, s... at pobox.com wrote:
>     Marcus> I'm looking for useful starting points, suggestions, and sample
>     Marcus> code, to implement a calendar iterator.
>
> Have you looked at dateutil?
>
>    http://labix.org/python-dateutil
>
>     >>> from dateutil.rrule import rrule, DAILY
>     >>> from dateutil.parser import parse
>     >>> rule = rrule(DAILY, count=5, dtstart=parse("2006-03-12"))
>     >>> for d in rule:
>     ...   print d
>     ...
>     2006-03-12 00:00:00
>     2006-03-13 00:00:00
>     2006-03-14 00:00:00
>     2006-03-15 00:00:00
>     2006-03-16 00:00:00
>
> Skip


This is exactly what I was looking for!  Thanks so much!!




More information about the Python-list mailing list