  
      >>> from datetime import datetime
      >>> from django.db.models import Count, DateTimeField
      >>> from django.db.models.functions import Trunc
      >>> Experiment.objects.create(start_time=datetime(2015, 6, 15, 14, 30, 50, 321))
      >>> Experiment.objects.create(start_time=datetime(2015, 6, 15, 14, 40, 2, 123))
      >>> Experiment.objects.create(start_time=datetime(2015, 12, 25, 10, 5, 27, 999))
      >>> experiments_per_day = Experiment.objects.annotate(
      ...    start_day=Trunc('start_time', 'day', output_field=DateTimeField())
      ... ).values('start_day').annotate(experiments=Count('id'))
      >>> for exp in experiments_per_day:
      ...     print(exp['start_day'], exp['experiments'])
 
</s> remove     ...    start_day=Trunc('start_time', 'day', output_field=DateTimeField())
 </s> add     ...    start_day=Trunc('start_datetime', 'day', output_field=DateTimeField()) </s> remove     >>> Experiment.objects.create(start_time=start1, start_date=start1.date())
    >>> Experiment.objects.create(start_time=start2, start_date=start2.date())
    >>> Experiment.objects.create(start_time=start3, start_date=start3.date())
 </s> add     >>> Experiment.objects.create(start_datetime=start1, start_date=start1.date())
    >>> Experiment.objects.create(start_datetime=start2, start_date=start2.date())
    >>> Experiment.objects.create(start_datetime=start3, start_date=start3.date()) </s> remove     >>> Experiment.objects.create(start_time=start1, start_date=start1.date())
 </s> add     >>> Experiment.objects.create(start_datetime=start1, start_date=start1.date()) </s> remove     ...    start_time=start, start_date=start.date(),
    ...    end_time=end, end_date=end.date())
 </s> add     ...    start_datetime=start, start_date=start.date(),
    ...    end_datetime=end, end_date=end.date()) </s> remove     ...    start_day=Trunc('start_time', 'day', output_field=DateTimeField())
 </s> add     ...    start_day=Trunc('start_datetime', 'day', output_field=DateTimeField())
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 30, 50, 321))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 40, 2, 123))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 12, 25, 10, 5, 27, 999))
  
      >>> from datetime import datetime
      >>> from django.db.models import Count, DateTimeField
      >>> from django.db.models.functions import Trunc
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 30, 50, 321))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 40, 2, 123))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 12, 25, 10, 5, 27, 999))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 30, 50, 321))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 40, 2, 123))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 12, 25, 10, 5, 27, 999))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 30, 50, 321))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 6, 15, 14, 40, 2, 123))
    >>> Experiment.objects.create(start_datetime=datetime(2015, 12, 25, 10, 5, 27, 999))
      >>> experiments_per_day = Experiment.objects.annotate(
      ...    start_day=Trunc('start_time', 'day', output_field=DateTimeField())
      ... ).values('start_day').annotate(experiments=Count('id'))
      >>> for exp in experiments_per_day:
      ...     print(exp['start_day'], exp['experiments'])
keep keep keep keep replace replace replace keep keep keep keep keep
 Refs #25774 -- Adjusted datetime database function docs field names. 
docs/ref/models/database-functions.txt