如何更改默认的Django日期模板格式? [英] How can I change the default Django date template format?

查看:52
本文介绍了如何更改默认的Django日期模板格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有ISO8601格式的日期,%Y-%m-%d 。但是,当日期传递到模板时,它以类似 Oct的形式出现。 2011年6月16日

I have dates in ISO 8601 format in the database, %Y-%m-%d. However, when the date is passed on to the template, it comes out as something like Oct. 16, 2011.

有没有一种方法可以将格式调整为所需的格式?

Is there a way that I can manipulate the format to whatever I want?

推荐答案

日期模板标记

settings.DATE_FORMAT

这篇关于如何更改默认的Django日期模板格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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