如何在HTML{{ post.published_date }}
标记处省略时间?你知道吗
我使用Python和Django,我试图显示发布的日期,但我不想显示时间。你知道吗
<!--html file-->
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }} ...   {{ 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
如果你只想在模板中输入日期,试试这个。有关详细信息,请参阅docs
相关问题 更多 >
编程相关推荐