Thursday, August 21, 2014

Re: Feeling some serious timezone pain

Den 21/08/2014 kl. 00.09 skrev Chris Whiten <chris.whiten@gmail.com>:

> I can understand that sentiment... But that doesn't change the fact that 12:00 PM on the Python side renders as 11 AM in the template, right?

Your database stores the datetime as (the equivalent of) 16:00 UTC, right? Which is expected, because you POST'ed 12:00 Toronto time, and the date was in August, and Toronto is presumably 4 hours behind of UTC in August (haven't checked). But your tamplate renders the correct datetime wrong?So the template must be doing the wrong thing.

Can you show your settings.py timezone values? And the template code which renders the localized datetime? (see https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#time-zone-aware-output-in-templates)

Erik

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/C444446F-835E-414E-9B07-97296598D5A2%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment