3

time.mktime is said to be the reverse of time.localtime.

Where is the reverse of time.gmtime? It is needed to convert the result of email.utils.parsedate to normal UNIX time.

The only approximation is hack like this:

time.mktime(email.utils.parsedate(smth)) - time.altzone

How to do it right?

Vi.
  • 37,014
  • 18
  • 93
  • 148

1 Answers1

5

Look at calendar.timegm(tuple)

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
Dave
  • 166
  • 1
  • 3