Skip to content

timezone error in parse_rfc822 #285

Open
@shortwinds

Description

@shortwinds

Parse datetime string error in parse_rfc822.
parsedate_to_datetime use datetime.timezone.utc in email.utils which depends local settings.

test_code:

from odps.utils import  parse_rfc822
rfc822_str = "Thu, 05 Oct 2023 14:30:00 +0000"
dt = parse_rfc822(rfc822_str)
print(dt)

mac output:

2023-10-05 22:30:00

docker output:

2023-10-06 06:30:00

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions