return objects with datetime field with default_timezone

6 views
Skip to first unread message

Charles Sartori

unread,
Mar 29, 2016, 8:03:05 PM3/29/16
to Django users

I am using USE_TZ = True and TIME_ZONE = 'America/Sao_Paulo' when I save some datetime field it will save on MySQL in UTC as expected, but when I query this object and print object.date it still in UTC, I tried to set timezone.activate(timezone.get_default_timezone()) before querying but the result is the same. Convert from UTC to other timezone automatically is possible only on template using {% load tz %}? Can I get converted datetimes on querysets?
Reply all
Reply to author
Forward
0 new messages