django's timezone.now does not show the right time

See question #2 in the "Usage" section of the Django docs.

>>> from django.utils import timezone
>>> timezone.localtime(timezone.now())

Since the doc above also talks about a best practice, including an excerpt below:

How can I obtain the local time in the current time zone?

Well, the first question is, do you really need to?

You should only use local time when you’re interacting with humans, and the template layer provides filters and tags to convert datetimes to the time zone of your choice.

Furthermore, Python knows how to compare aware datetimes, taking into account UTC offsets when necessary. It’s much easier (and possibly faster) to write all your model and view code in UTC. So, in most circumstances, the datetime in UTC returned by django.utils.timezone.now() will be sufficient.


from django.utils import timezone
time = timezone.localtime() 

It will give your local time that whatever your TIME_ZONE set to.

time = timezone.localtime(timezone.now()) # same result, but it is redundant.