在HTML{{发布日期}}标签?

2024-04-20 13:44:47 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在HTML{{ post.published_date }}标记处省略时间?你知道吗

我使用Python和Django,我试图显示发布的日期,但我不想显示时间。你知道吗

<!--html file-->
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }} ... &nbsp {{ post.published_date }}</a>

例如

我所拥有的:

  • This is post title ... Nov. 19, 2019 p.m. 5:37
  • This is post title, too! ... Nov. 24, 2019 a.m. 2:30

我想要的是:

  • This is post title ... nov. 19, 2019
  • This is post title, too! ... nov. 24, 2019

Tags: django标记datetitleishtml时间this