      >>> from django.utils import timezone
      >>> start1 = datetime(2014, 6, 15, 14, 30, 50, 321, tzinfo=timezone.utc)
      >>> start2 = datetime(2015, 6, 15, 14, 40, 2, 123, tzinfo=timezone.utc)
      >>> start3 = datetime(2015, 12, 31, 17, 5, 27, 999, tzinfo=timezone.utc)
      >>> 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())
      >>> experiments_per_year = Experiment.objects.annotate(
      ...    year=TruncYear('start_date')).values('year').annotate(
      ...    experiments=Count('id'))
      >>> for exp in experiments_per_year:
      ...     print(exp['year'], exp['experiments'])
 
</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     >>> 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))
 </s> add     >>> 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)) </s> remove     ...    start_day=Trunc('start_time', 'day', output_field=DateTimeField())
 </s> add     ...    start_day=Trunc('start_datetime', 'day', output_field=DateTimeField()) </s> remove     ...     date=TruncDate('start_time'),
    ...     day=TruncDay('start_time', tzinfo=melb),
    ...     hour=TruncHour('start_time', tzinfo=melb),
    ...     minute=TruncMinute('start_time'),
    ...     second=TruncSecond('start_time'),
 </s> add     ...     date=TruncDate('start_datetime'),
    ...     day=TruncDay('start_datetime', tzinfo=melb),
    ...     hour=TruncHour('start_datetime', tzinfo=melb),
    ...     minute=TruncMinute('start_datetime'),
    ...     second=TruncSecond('start_datetime'), </s> remove     ...    start_time=start_2015, start_date=start_2015.date(),
    ...    end_time=end_2015, end_date=end_2015.date())
 </s> add     ...    start_datetime=start_2015, start_date=start_2015.date(),
    ...    end_datetime=end_2015, end_date=end_2015.date())
    >>> 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())
      >>> from django.utils import timezone
      >>> start1 = datetime(2014, 6, 15, 14, 30, 50, 321, tzinfo=timezone.utc)
      >>> start2 = datetime(2015, 6, 15, 14, 40, 2, 123, tzinfo=timezone.utc)
      >>> start3 = datetime(2015, 12, 31, 17, 5, 27, 999, tzinfo=timezone.utc)
    >>> 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())
    >>> 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())
    >>> 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())
      >>> experiments_per_year = Experiment.objects.annotate(
      ...    year=TruncYear('start_date')).values('year').annotate(
      ...    experiments=Count('id'))
      >>> for exp in experiments_per_year:
      ...     print(exp['year'], 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