title: How can I compare just the dates of datetime in SQLAlchemy?
body: <p>I have a query in <code>SQLAlchemy</code>:</p>
  
  <pre><code>weekly_schedule = WeeklyHour.query.filter(
      and_(
          WeeklyHour.start_time.in_(week_dates),
          WeeklyHour.end_time.in_(week_dates),
          WeeklyHour.employee == employee
          )
      ).all()
  </code></pre>
  
  <p>I am getting the dates of the current week like so:</p>
  
  <pre><code>today = datetime.datetime.today()
  week_dates = [today + datetime.timedelta(days=i) for i in xrange(0 - today.weekday(), 7 - today.weekday())]
  </code></pre>
  
  <p>This returns a list of the current week in <code>datetimes</code>. Like so: </p>
  
  <pre><code>[datetime.date(2014, 4, 7), datetime.date(2014, 4, 8), datetime.date(2014, 4, 9), datetime.date(2014, 4, 10), datetime.date(2014, 4, 11), datetime.date(2014, 4, 12), datetime.date(2014, 4, 13)]
  </code></pre>
  
  <p>The problem is that the <code>WeeklyHour</code> is a <code>datetime</code> when the employee started and ended that day. And <code>week_dates</code> are a specific time set to <code>now()</code>.  I will never get results because the <code>time</code> of the <code>datetime</code> won't match. All I really want to compare is the <code>date</code> portion of the <code>datetime</code>. My current solution (which works but is dumb) is to store separate <code>dates</code> of the <code>datetime</code>.</p>