      >>> Experiment.objects.create(
      ...    start_time=start_2015, start_date=start_2015.date(),
      ...    end_time=end_2015, end_date=end_2015.date())
      >>> Experiment.objects.annotate(
      ...     year=ExtractYear('start_time'),
      ...     month=ExtractMonth('start_time'),
      ...     day=ExtractDay('start_time'),
      ...     weekday=ExtractWeekDay('start_time'),
      ...     hour=ExtractHour('start_time'),
      ...     minute=ExtractMinute('start_time'),
      ...     second=ExtractSecond('start_time'),
      ... ).values(
      ...     'year', 'month', 'day', 'weekday', 'hour', 'minute', 'second',
      ... ).get(end_time__year=ExtractYear('start_time'))
      {'year': 2015, 'month': 6, 'day': 15, 'weekday': 2, 'hour': 23, 'minute': 30, 'second': 1}
  
 
</s> remove     ... ).get(end_time__year=ExtractYear('start_time'))
 </s> add     ... ).get(end_datetime__year=ExtractYear('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()) </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()) </s> remove     ...        day=ExtractDay('start_time'),
    ...        weekday=ExtractWeekDay('start_time'),
    ...        hour=ExtractHour('start_time'),
 </s> add     ...        day=ExtractDay('start_datetime'),
    ...        weekday=ExtractWeekDay('start_datetime'),
    ...        hour=ExtractHour('start_datetime'), </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'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
      >>> Experiment.objects.create(
      ...    start_time=start_2015, start_date=start_2015.date(),
      ...    end_time=end_2015, end_date=end_2015.date())
      >>> Experiment.objects.annotate(
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
    ...     year=ExtractYear('start_datetime'),
    ...     month=ExtractMonth('start_datetime'),
    ...     day=ExtractDay('start_datetime'),
    ...     weekday=ExtractWeekDay('start_datetime'),
    ...     hour=ExtractHour('start_datetime'),
    ...     minute=ExtractMinute('start_datetime'),
    ...     second=ExtractSecond('start_datetime'),
      ... ).values(
      ...     'year', 'month', 'day', 'weekday', 'hour', 'minute', 'second',
      ... ).get(end_time__year=ExtractYear('start_time'))
      {'year': 2015, 'month': 6, 'day': 15, 'weekday': 2, 'hour': 23, 'minute': 30, 'second': 1}
  
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 Refs #25774 -- Adjusted datetime database function docs field names. 
docs/ref/models/database-functions.txt