📅  最后修改于: 2022-03-11 14:46:17.780000             🧑  作者: Mango
# Add a method to your model class
# call it like any other field in your template
class Yourclass(models.Model):
date_field = models.DateTimeField()
def date_trunc_field(self):
return self.date_field.date()