Created
May 5, 2020 20:14
-
-
Save elinaldosoft/6368721ed10f2e416962b93adcb57a33 to your computer and use it in GitHub Desktop.
Convert datetime to local date (Django)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytz | |
from django.utils import timezone | |
timezone.localtime(profile.updated_at.replace(tzinfo=pytz.UTC)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment