Question

Timezone settings settings.py:

USE_TZ = True
TIME_ZONE = 'Europe/Moscow' # +4

Record in database table(postgresql 9.1, timestamp with timezone :

2012-12-19 15:30:51.164368+04

Django date filter:

date(object.date,"d.m.Y H:i:s"),

And after all this manipulations datetime filed output in template as :

19.12.2012 11:30:51

Why this happens? Why django don't use TZ information?

Was it helpful?

Solution

When USE_TZ is False, this is the time zone in which Django will store all datetimes. When USE_TZ is True, this is the default time zone that Django will use to display datetimes in templates and to interpret datetimes entered in forms.

Check this document, Django Doc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top