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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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?