MCPcopy
hub / github.com/django/django / TruncDate

Class TruncDate

django/db/models/functions/datetime.py:383–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381
382
383class TruncDate(TruncBase):
384 kind = "date"
385 lookup_name = "date"
386 output_field = DateField()
387
388 def as_sql(self, compiler, connection):
389 # Cast to date rather than truncate to date.
390 sql, params = compiler.compile(self.lhs)
391 tzname = self.get_tzname()
392 return connection.ops.datetime_cast_date_sql(sql, tuple(params), tzname)
393
394
395class TruncTime(TruncBase):

Calls 1

DateFieldClass · 0.90