class Trunc(expression, kind, output_field=None, tzinfo=None, **extra) [source]
Truncates a date up to a significant component.
When you only care if something happened in a particular year, hour, or day, but not the exact second, then Trunc (and its subclasses) can be useful to filter or aggregate your data. For example, you can use Trunc to calculate the number of sales per day.
Trunc takes a single expression, representing a DateField or DateTimeField, a kind representing a date part, and