adafruit / Adafruit_CircuitPython_datetime

Basic date and time types. Implements a subset of the CPython datetime module.
MIT License
4 stars 9 forks source link

timezone lacks dst attribute #18

Closed bablokb closed 2 years ago

bablokb commented 2 years ago

The timezone class lacks an attribute for dst (should also be in the constructor):

Adafruit CircuitPython 7.3.0-beta.1 on 2022-04-07; Pimoroni Badger 2040 with rp2040
>>> import adafruit_datetime
>>> import rtc
>>> r = rtc.RTC()
>>> dt =addafruit_datetime.datetime(r.datetime.tm_year,r.datetime.tm_mon,r.datetime.tm_mday,r.datetime.tm_hour,r.datetime.tm_min,r.datetime.tm_sec,0,adafruit_datetime.timezone.utc)
>>> dt.ctime()
'Wed Jan  1 00:01:43 2020'
>>> dt.timetuple()
Zurückverfolgung (jüngste Aufforderung zuletzt):
  Datei "<stdin>", Zeile 1, in <module>
  Datei "adafruit_datetime.py", Zeile 1485, in timetuple
  Datei "adafruit_datetime.py", Zeile 1479, in dst
AttributeError: 'timezone' Objekt hat kein Attribut 'dst'