Hi Dan!
I'm the author of the temporal substraction changes in 1.10.
I believe the main culprit here is your usage of `Func` with no explicit
`output_field`. When this parameter is not specified the return type of `Func`
expressions is determined by it's wrapped expressions given there's either
only one or they are all of the same type[1].
In your case the `Func('start', function='UNIX_TIMESTAMP')` expression is
assumed to have a return type of `models.DateTimeField` as it's the data type of
the `TaskLog.start` field. It should have been declared with an `output_field`
of `models.IntegerField()` instead.
Let me know if that doesn't make sense to you.
Cheers,
Simon
[1]
https://github.com/django/django/blob/19e20a2a3f763388bba9263d56db34012e90cf5b/django/db/models/expressions.py#L265-L270P.-S. You should replace your `.extra()` usage with an `annotate()` call as
this API is meant to be deprecated:
TaskLog.objects.annotate(
day=Func('start', 10, function='LEFT', output_field=models.CharField()),