how to work with time.strftime in django 1.6
Question: I am one of the new user in django 1.6 but one thing very bad I have noticed
in this version of django is that time.strftime("%H:%M:%S") does not working
and giving a wrong time in my view . Is there any alternating approach for
getting a right time in django view or not ?

_**Note : if you type print(time.strftime("%H:%M:%S")) in python 3 you will
see a right time but in django 1.6 it is not true_**

Thank you.


Answer: Maybe you're dealing with UTC time. Convert it to local time before call
`strftime`:

    
    
    >>> from django.utils import timezone
    >>> now = timezone.now()
    >>> now.strftime('%H:%M:%S')
    '13:23:52'
    >>> timezone.localtime(now).strftime('%H:%M:%S')
    '22:23:52'
    

See [Time zones | Django documentation](https://docs.djangoproject.com/en/1.6/topics/i18n/timezones/).

