Profile

User profile and story timeline

user-img
nyg

https://blog.csdn.net/lanchunhui/article/details/51584812?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.queryctrv2&spm=1001.2101.3001.4242.1&utm_relevant_index=3使用这个网上文章做参考,完美解决本地时间与UTC时间戳的问题!

回复

  • ·
    from datetime import datetime @app.route('/') def index( ): return render_template('index.html', current_time=datetime.utcnow( ))第一,这个模版指的是要本地化时间的模版;第二、{{ moment(post.timestamp).format('LLL') }}中的post.timestamp
  • ·
    post.timestamp是指发布文章时的时间戳