List comprehension failing to filter list (possible date comparison issue?)
<p>I have a list of dictionaries. Each dictionary contains a timestamp field. I am trying to extract only the dictionaries that have timestamps for a specified <strong>DATE</strong></p>

<p>I am using this piece of code to extract the rows, but it is not matching any rows:</p>

<pre><code>def extract_rows_for_date(datarows, specified_date):
    date_match_pattern = '%Y-%m-%d %H:%M:%S'
    extracted_timestamps = [datetime.strptime(x['ts'], date_match_pattern)
                            for x in datarows
                            if datetime.strptime(x['ts'], date_match_pattern).date() == specified_date.date()]
    # ... more logic
</code></pre>

<p>For example, if a 'row' contains a timestamp of '2012-05-14 08:24:00', then I would expect it to be pattern matched if a date of '2012-05-14' is specified as the date to match. However, at the moment,  it is not being matched using the list comprehension and date comparison logic above.</p>

<p>What is wrong with the snippet above?</p>
