return objects with datetime field with default_timezone

Visto 6 veces
Saltar al primer mensaje no leído

Charles Sartori

no leída,
29 mar 2016, 20:03:0529/3/16
a 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?
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos