Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gmodel.py: UnknownTimezoneWarning: tzname EDT identified but not understood #239

Open
omicron-b opened this issue Apr 12, 2020 · 1 comment

Comments

@omicron-b
Copy link

pdate = parser.parse(md)
test_at = pdate.isoformat()

In Python 3.8.2 these lines cause a warning:

/usr/lib/python3/dist-packages/dateutil/parser/_parser.py:1199: UnknownTimezoneWarning: tzname EDT identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a future version, this will raise an exception.
  warnings.warn("tzname {tzname} identified but not understood.  "

This can be patched like this:

        if md.endswith('EDT'):
            md = md.replace('EDT','-0400')
        pdate = parser.parse(md)
        test_at = pdate.isoformat()
@omicron-b
Copy link
Author

or like:

        if md.endswith('EDT'):
            md = md[:-3] + '-0400'
        pdate = parser.parse(md)
        test_at = pdate.isoformat()

Is explicitly replacing the last 3 symbols better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant