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

datetime.fromtimestamp() overflows in all cases #25

Open thomaspaulin opened 7 months ago

thomaspaulin commented 7 months ago

I'm running CircuitPython 8.2.9 on a Matrix Portal M4 board and I've not been able to get datetime.fromtimestamp() working with any parameters.

For example I ran the following in the REPL

>>> datetime.fromtimestamp(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_datetime.py", line 1370, in fromtimestamp
  File "adafruit_datetime.py", line 1349, in _fromtimestamp
OverflowError: timestamp out of range for platform time_t

I see the same error when using different values of int and float dtypes.