You want to print the local time and the correct function for this is localtime()
, not the gmtime()
that gives you the universal call time (no time zone).
from time import localtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", localtime()))
See running on ideone . And in Coding Ground . Also put GitHub for future reference .
Just be careful because in many cases the correct thing is to work with universal and not local time. We even see a lot of questions here from people who are having trouble getting started using it wrong on systems and then can not fix it anymore.
Conceptually there is already an error in this +0000
fixed that gives misleading information, and even +0300
will only be certain by coincidence at certain times of the year. But the subject is absurdly extensive to put here.