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

a tzinfo subclass must implement utcoffset() #36

Open
QubeX2 opened this issue Apr 1, 2021 · 0 comments
Open

a tzinfo subclass must implement utcoffset() #36

QubeX2 opened this issue Apr 1, 2021 · 0 comments

Comments

@QubeX2
Copy link

QubeX2 commented Apr 1, 2021

try:
    utc = datetime.timezone.utc
except:
    # Support Python 2.7
    class UTC(datetime.tzinfo):
        def fromutc(self, dt):
            return dt

        def **utcffset**(self, dt):
            return datetime.timedelta(0)

        def dst(self, dt):
            return None

        def tzname(self, dt):
            return 'UTC'

    utc = UTC()

This method is misspelled, should be utcoffset

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