문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top