title: Formatting dates for annotating count in Django + Python 3
body: <p>I'm currently trying to annotate and count some dates, based on the number of times they appear.</p>
  
  <pre><code>visits = Subs.objects.filter(camp=campdata, timestamp__lte=datetime.datetime.today(), timestamp__gt=datetime.datetime.today()-datetime.timedelta(days=30)).\
  values('timestamp').annotate(count=Count('timestamp'))
  </code></pre>
  
  <p>If I print this in a for loop like, </p>
  
  <pre><code>for a in visits:
    print(a)
  </code></pre>
  
  <p>I would get back the following in Json.</p>
  
  <pre><code>{'timestamp': datetime.datetime(2018, 10, 5, 15, 16, 25, 130966, tzinfo=&lt;UTC&gt;), 'count': 1}
  {'timestamp': datetime.datetime(2018, 10, 5, 15, 16, 45, 639464, tzinfo=&lt;UTC&gt;), 'count': 1}
  {'timestamp': datetime.datetime(2018, 10, 6, 8, 43, 24, 721050, tzinfo=&lt;UTC&gt;), 'count': 1}
  {'timestamp': datetime.datetime(2018, 10, 7, 4, 54, 59, tzinfo=&lt;UTC&gt;), 'count': 1}
  </code></pre>
  
  <p>This is kinda the right direction, however, it's counting to the second.. I just need to days, so that the event that happened on 2018, 10, 5 would be count: 2 for example.</p>
  
  <p>Can anyone lead me into the right direction?</p>
  
  <p>Additionally, whats the most "django" way of converting the dates into something more json / api friendly?</p>
  
  <p>My ideal json return would be something like </p>
  
  <pre><code>{'timestamp': 2018-10-5, 'count': 2}
  </code></pre>
  
  <p>Thanks!</p>