title: Django template date comparison
body: <p>I'm trying to compare dates in my html template. If the current date falls between the start and end date, it will display available. However, my current code only shows <code>Not available</code> even when my date falls between the start and end date.</p>
  
  <p>The now variable is generated by dateTime.now() and is passed to the html. The dates are in the format <code>April 16, 2018, 1:44 p.m.</code> using Django's <code>DateTimeField</code></p>
  
  <pre><code>&lt;tbody&gt;
      {% for key in keys%}
      &lt;tr&gt;
          &lt;th scope="row"&gt;{{key.name}}&lt;/th&gt;
          &lt;td&gt;{{key.lock}}&lt;/td&gt;
          &lt;td&gt;{{key.start_date}}&lt;/td&gt;
          &lt;td&gt;{{key.end_date}}&lt;/td&gt;
          {% if now &gt;= key.start_date and now &lt;= key.end_date %}
          &lt;td&gt;Available&lt;/td&gt;
          {% else %}
          &lt;td&gt;Not Available&lt;/td&gt;
          {% endif %}
          &lt;td&gt;&lt;button type="button" class="btn btn-primary btn-rounded btn-sm my-0"&gt;Unlock&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      {% endfor %}
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Code from views.py</p>
  
  <pre><code>    keys = Key.objects.filter(user=request.user)
      dateTimeNow = datetime.now()
      args = {'keys': keys, 'now': dateTimeNow}
      return render(request, self.template_name, args)
  </code></pre>