how to build a list of mx.DateTime objects from a start and end date?

python at sarcastic-horse.com python at sarcastic-horse.com
Tue Sep 16 16:02:53 EDT 2003


Hi-


I want to make a list of mx.DateTime objects that cover all the monthly
intervals between two points.  For example:

>>> import mx.DateTime
>>> nov1999 = mx.DateTime.Date(1999, 11)
>>> mar2003 = mx.DateTime.Date(2003, 3)
>>> alldates = mk_list(startdate=nov1999, enddate=mar2003)
>>> alldates
[ ... a bunch of mx.DateTime objects including and between the startdate
and enddate ...]

How would I do something like this?


Thanks for the help.





More information about the Python-list mailing list