Django模板中使用date过滤器 格式化日期

作者:我就是个世界 发表于:2011-06-11
Django模板中使用date过滤器 格式化日期
[color=#C0C0C0]Django template to format the date using the date filter[/color]

[code] {{scenic.publish|date:"Y年m月d日 H时i分"}} [/code]
[quote]
H 小时 00-23
i 分钟 00-59
Y 年 yyyy 1999
m 月 01-12
[/quote]

使用date过滤器

显示效果
[code]2011年06月11日 19时13分[/code]

参考资料:http://djangobook.py3k.cn/appendixF/index.html
版权声明

未经许可,不得转载。