a tzinfo subclass must implement utcoffset()
QubeX2 opened this issue · 0 comments
QubeX2 commented
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