суббота, 2 июня 2012 г., 1:05:01 UTC+4 пользователь Aymeric Augustin
написал:
>
> On 1 juin 2012, at 20:56, Artem Andreev wrote:
> > I should converts a lot of manually, which increases the possibility of
> error. Maybe this is just my experience.
>
> You should be
Anssi, Aymeric thanks!
I enabled USE_TZ only 3 days ago and missed that any datetime returned by
the database is expressed with tzinfo = UTC. Until that moment I though
that function localtimezone.now() that will return
localtime(timezone.now()) solves most of my problems. Now I want to turn
of
Hello!
In django 1.4 with USE_TZ=true timezone.now() returns
datetime.utcnow().replace(tzinfo=utc).
Such datetime aware objects are handled properly in forms, templates and
other places inside django framework.
But when I prepare datetimes for ajax responses using strftime I always do
localtime