martinrusev / imbox

Python IMAP for Human beings
MIT License
1.18k stars 188 forks source link

Preserve timezone info in date parsing #205

Closed AT0myks closed 2 years ago

AT0myks commented 2 years ago

The current way of parsing dates ignores timezone information. Using email.utils.parsedate_to_datetime is simpler and preserves the timezone. Also time.mktime's argument is the time in local time, which is not what email.utils.parsedate returns because it simply ignores timezone data in the date string.