Re: Django: How to get American date format in a form?
Yes you are absolutely right about Date_Format and Time_Format.
But the Time_Format gives me trouble. By default it is defined as
TIME_FORMAT = 'P' and the output is p.m. (see two dots)
My TIME_INPUT_FORMATS = ('%I:%M %p',) produces PM (in capital case and
I prefer it this way)
I tried to change TIME_FORMAT = 'P' to TIME_FORMAT = '%p', but it breaks.
On 13/08/12 21:52, Melvyn Sopacua wrote:
> On 13-8-2012 22:41, Melvyn Sopacua wrote:
>> On 13-8-2012 17:40, houmie wrote:
>>
>>> Its just a bit odd that templates show 11:15 p.m. Slight difference in
>>> the formatting. Also the dates within templates are defined like Aug
>>> 13, 2012. Doesn't confirm with my definition in formats.py.
>>> Are they stored somewhere else?
>> No, but you need the localize filter or tag:
>> <https://docs.djangoproject.com/en/1.4/topics/i18n/formatting/#controlling-localization-in-templates>
> Wait, if this is the same data from the model, then you need to change
> the DATE_FORMAT. DATE_INPUT_FORMAT is for form fields, since the form
> field needs to be able to change it back to a format that python's
> datetime.date will understand. DATE_FORMAT is used for plain output.
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home