Tomas Zulberti
未读,2010年6月5日 18:17:122010/6/5登录即可回复作者
登录即可转发
您无权在此群组中删除帖子
要么此群组的电子邮件地址为匿名状态,要么您得查看成员电子邮件地址权限才能查看原始帖子
收件人 Django users
Hi. I have the following values in the settings.py:
USE_L10N = True
DATETIME_FORMAT = '%d/%m/%Y'
When the date is printed it prints: "Nov. 24, 1983". The date is:
datetime.date(1983, 11, 24).
As far as I was able to follow the code, in the django/utils/
formats.py, the it uses the the get_format function because I have in
the settings USE_L10N. So it will use get_format will use
format_module of my sistem (english) to format the date.
The problem is that if I don't use USE_L10N to True, the function
localize() in the same module will return a datetime.date() object
insted of using the settings DATE_FORMAT value. After that the method,
force_unicode will be used, which it doesn't use the settings at all
(it does str(datetime.date())).
So my question is: is this a bug, or I am doing something wrong (I am
sure I might be doing something grong but I don't know where).
Thanks in advance,
Tomas Zulberti
pd: Sorry for my bad English.