我想接收时差,所以我在已安装的应用程序中添加了 'django.contrib.humanize',并在我的模板中添加了 '{% load humanize %}',并按如下方式使用它:
{% for notification in request.session.notifications %}
<li> <div class="media">
<div class="media-left">
<div class="media-object">
<img data-src="holder.js/50x50?bg=cccccc" class="img-circle" alt="50x50" style="width: 50px; height: 50px;" src="{% static 'img/profile.png' %}" data-holder-rendered="true">
</div>
</div>
<div class="media-body">
<strong class="notification-title"><a href="#">{{ notification.fields.actor_object_id }} {{ notification.fields.verb }} {{ notification.fields.target_object_id }}</a></strong>
<div class="notification-meta">
<small class="timestamp">{{ notification.fields.timestamp|naturaltime }}</small>
</div>
</div>
</div>
</li>
{% endfor %}
但结果再次相同:2017-01-18T10:59:11Z