time.mktime called reverse time localtime.
Where is the reverse side of .gmtime time? You need to convert the result of email.utils.parsedate to normal UNIX time.
The only approximation is cracked as follows:
time.mktime(email.utils.parsedate(smth)) - time.altzone
How to do it right?
source
share