0

我想知道是否有办法在渲染日期时更改日期的语言(与更改格式相同的方法:{{mydate|date:"d FY - H:i"}})。

我查看了文档:https ://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#date 但我什么也没找到。

谢谢您的帮助。

4

1 回答 1

0

You could change the locale before rendering it as a string. Then change it back after. Although, I'm not sure why you want to have a date in a language different from your other output. Maybe explain what you are trying to accomplish with this, first. There is no built-in way to do it simply formatting the date.

于 2012-11-21T19:53:16.957 回答