On 2013-09-22, at 18:12 , Euirim Choi wrote:
> Hello everyone,
> This might be a newbie question but I'm not sure why this code displays: It
> is now Sept. 22, 2013, 11:29 a.m..
>
> from django.http import HttpResponse
> from django.template import Context
> from django.template.loader import get_template
> import datetime
>
> def hello(request):
> return HttpResponse("Hello World!")
> def current_time(request):
> rnow = datetime.datetime.now()
> t = get_template("current_time.html")
> html = t.render(Context({"current_date": rnow}))
> return HttpResponse(html)
>
>
>
> How come this code doesn't display instead: It is now 2013-09-22
> 11:14:11.947265?
> Thanks.
https://docs.djangoproject.com/en/1.6/topics/i18n/formatting/
> Django’s formatting system is capable to display dates, times and
> numbers in templates using the format specified for the current locale.
> It also handles localized input in forms.
> When it’s enabled, two users accessing the same content may see dates,
> times and numbers formatted in different ways, depending on the formats
> for their current locale.
Formatting is enabled if USE_L10N is set to True, which startproject does.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.