Django模板datetime.weekday名称 [英] Django template datetime.weekday name

查看:50
本文介绍了Django模板datetime.weekday名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将模板中日期时间对象的工作日显示为工作日的实际名称?基本上,我希望它打印星期五而不是 5 .

Is there a way to display the weekday of a datetime object in a template as the actual name of the weekday? Basically I want it to print Friday instead of 5.

推荐答案

请参见

See the documentation for the built-in date filter. From there you'll see you need to use:

l星期几,文字长.星期五"

l Day of the week, textual, long. 'Friday'

这篇关于Django模板datetime.weekday名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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