On Fri, Oct 9, 2009 at 2:16 PM, Glen Zangirolami <[email protected]>wrote:
> If i have a list of dates:date_list =
> ['2008-12-29','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-01-05']
>
> How do I find the missing dates in the range of dates and insert them into
> the list so I get?
> date_list =
> ['2008-12-29','2008-12-30','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-12-04','2008-01-05']
>
> Hopefully the case is that I haven't found the correct python module that
> does it ;)
>
The datetime module exists... you could easily write a function that does
something along the lines of:
def date_range(startdate, enddate):
#do something here to make a range of dates
though you may want to write a function that checks for a missing date
first.
HTH,
Wayne
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor