On Wednesday, February 9, 2011 3:31:53 PM UTC, creecode wrote:
>
> Hello all, 
>
> I'm trying to use the now template tag < 
> http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#now > 
> with the predefined format DATE_FORMAT and the now tag seems to be 
> processing the predefined format as a custom format. 
>
> I tried... 
>
> {% now "DATE_FORMAT" %} 
>
> ...and get back... 
>
> WedAMPSTEPST0FebE_February-0800RFebAMPST 
>
> Any thoughts on what I'm doing wrong? 
>
> I'm using Django 1.2.x, have USE_I18N and USE_L10N set to True, and 
> LANGUAGE_CODE is 'en-us' in settings.py. 
>
> Toodle-loooooooo 
> creecode 
>

This is very bizarre. Obviously, what's happening is that the string 
"DATE_FORMAT" is being interpreted as a literal date format, instead of a 
reference to your locale's actual date string.

What's even more bizarre is that it appears that the documentation is 
flat-out wrong: the "now" tag does not take the "DATE_FORMAT" parameter, 
like the "date" filter does. No idea why, or why no-one's noticed it until 
now. I've confirmed that this is the case in 1.2.4, and the code hasn't 
changed in trunk. It would be worth raising a ticket for this.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to