{% extends "base.html" %}
{% block page_content %}
<h1>Hello World!</h1>
<p>The local date and time is {{ moment(current_time).format('LLL') }}.</p>
<p>That was {{ moment(current_time).fromNow(refresh=True) }}.</p>
{% endblock %}
<p>The local date and time is <span class="flask-moment" data-timestamp="2017-01-01T12:51:42Z" data-format="format('LLL')" data-refresh="0" style="display: none">2017-01-01T12:51:42Z</span>.</p>
<p>That was <span class="flask-moment" data-timestamp="2017-01-01T12:51:42Z" data-format="fromNow(0)" data-refresh="60000" style="display: none">2017-01-01T12:51:42Z</span></p>
我把开发者工具里右边箭头指向的框里的√去掉时间就显示出来了
---------------------------------------------------------------------------------------
我把index.html里面加了点代码,时间能够正常显示了,反正暂时还不知道为什么
index.html代码
current_time=datetime.utcnow(),大哥,你不是用的是utc时间嘛,我们不是UTC啊。用datetime.now()
你好,我也碰到这样的情况,不知道是什么原因。查看页面源码显示:
可能和“display:none”有关。