Django-在模板中显示当前日期和时间 [英] Django - present current date and time in template

查看:254
本文介绍了Django-在模板中显示当前日期和时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题很容易说明。

推荐答案

尝试使用内置的django模板标签和过滤器:
https://docs.djangoproject.com/ zh_cn / dev / ref / templates / builtins /?from = olddocs#now

Try using built-in django template tags and filters: https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#now

示例:

It is {% now "jS F Y H:i" %}
It is {% now "SHORT_DATETIME_FORMAT" %}

这篇关于Django-在模板中显示当前日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆