diff options
| author | hyfc <3365132+hyfc@users.noreply.github.com> | 2018-06-11 00:20:56 +0800 | 
|---|---|---|
| committer | hyfc <3365132+hyfc@users.noreply.github.com> | 2020-10-22 11:37:40 +0800 | 
| commit | 49f3ae04c9831aff10a75e2380eab48eac8144b8 (patch) | |
| tree | 19915fe06511bd4cfc6f9e187abf3302fbad4597 /utils | |
| parent | 257c603986d0ef18ac2c6896c733dcea1d699c45 (diff) | |
| download | telegram-mail-bot-49f3ae04c9831aff10a75e2380eab48eac8144b8.tar.gz telegram-mail-bot-49f3ae04c9831aff10a75e2380eab48eac8144b8.tar.bz2 telegram-mail-bot-49f3ae04c9831aff10a75e2380eab48eac8144b8.zip | |
display date as is
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/mail.py | 8 | 
1 files changed, 1 insertions, 7 deletions
| diff --git a/utils/mail.py b/utils/mail.py index c1cd3d8..2ead9ae 100644 --- a/utils/mail.py +++ b/utils/mail.py @@ -70,13 +70,7 @@ def get_mail_details(msg):      except IndexError:          maildetails.subject = subject      received_time = msg.get("Date") -    if received_time.endswith('(CST)'): -        maildetails.receivedtime = received_time -    else: -        time_str_fmt = "%a, %d %b %Y %H:%M:%S %z" -        time_obj = datetime.strptime(received_time, time_str_fmt) -        time_obj = time_obj.astimezone(pytz.timezone('Asia/Hong_Kong')) -        maildetails.receivedtime = time_obj.strftime(time_str_fmt) +    maildetails.receivedtime = received_time      parts = msg.get_payload()      content_charset = parts[0].get_content_charset() | 
