Thats for all the responses. I&#39;m going to use Kents method. I&#39;ll let you know what I work out.<div><br><div>Rudiger - I did think about that. Luckily I am generating the list with a start datetime and end datetime so if those don&#39;t exist </div>

<div>in either end if the list I can insert them after I check the dates between.</div></div>
<br><br><div class="gmail_quote">On Fri, Oct 9, 2009 at 5:11 PM, Rüdiger Wolf <span dir="ltr">&lt;<a href="mailto:rudiger.wolf@throughputfocus.com">rudiger.wolf@throughputfocus.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Ah! but are we sure that the max and min dates are actually in the list?<br>
If there are &#39;missing dates&#39; it might just be possible that it is the<br>
max or min date that is missing.<br>
<div><div></div><div class="h5"><br>
On Fri, 09 Oct 2009 16:43 -0400, &quot;Kent Johnson&quot; &lt;<a href="mailto:kent37@tds.net">kent37@tds.net</a>&gt; wrote:<br>
&gt; On Fri, Oct 9, 2009 at 3:16 PM, Glen Zangirolami &lt;<a href="mailto:digitalman66@gmail.com">digitalman66@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt; &gt; If i have a list of dates:<br>
&gt; &gt; date_list =<br>
&gt; &gt; [&#39;2008-12-29&#39;,&#39;2008-12-31&#39;,&#39;2008-01-01&#39;,&#39;2008-01-02&#39;,&#39;2008-01-03&#39;,&#39;2008-01-05&#39;]<br>
&gt; &gt; How do I find the missing dates in the range of dates and insert them into<br>
&gt; &gt; the list so I get?<br>
&gt; &gt; date_list =<br>
&gt; &gt; [&#39;2008-12-29&#39;,&#39;2008-12-30&#39;,&#39;2008-12-31&#39;,&#39;2008-01-01&#39;,&#39;2008-01-02&#39;,&#39;2008-01-03&#39;,&#39;2008-12-04&#39;,&#39;2008-01-05&#39;]<br>
&gt;<br>
&gt; I would do something like the following using datetime.datetime and<br>
&gt; datetime.timedelta:<br>
&gt; - convert each list item to a datetime object using datetime.strptime()<br>
&gt; - find the min and max datetimes in the list (use min() and max()<br>
&gt; - create a new list by incrementing the min date by timedelta(days=1)<br>
&gt; until it hits the max date<br>
&gt; - convert the new list to strings using datetime.strftime()<br>
&gt;<br>
&gt; Kent<br>
<br>
</div></div></blockquote></div><br>