5👍
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'
Source:stackexchange.com