I'm using a ESP32 with esp32-20210623-v1.16.bin installed.
For my project I need to use the RTC clock and evaluate the difference between 2 dates.
I run against several problems with utime module, that I do not understand and they are not coherent with the official documentation (https://docs.micropython.org/en/latest/ ... utime.html):
1) Time Epoch used by the system is in a different format:
Code: Select all
(year, month, day, day_of_the_week, hour, minute, second, millisecond)
Code: Select all
(year, month, mday, hour, minute, second, weekday, yearday)
2) utime.localtime gives are output minutes instead of seconds as stated in the documentation. In fact:
Code: Select all
>>> utime.mktime((2021, 7, 3, 3, 4, 0, 0, 0)) - utime.mktime((2021, 7, 3, 3, 3, 0, 0, 0))
60
Code: Select all
>>> utime.localtime(utime.mktime((2021, 7, 1, 3, 26, 0, 0, 0)))
(2021, 7, 1, 3, 26, 0, 3, 182)
Code: Select all
>>> utime.mktime((2021, 7, 3, 3, 23, 0, 0, 0)) - utime.mktime((2021, 7, 3, 3, 22, 0, 0, 0))
60
Code: Select all
>>> utime.mktime((2021, 7, 4, 4, 1, 0, 0, 0)) - utime.mktime((2021, 7, 3, 3, 23, 0, 0, 0))
88680
what am I missing here? I'm referring to the wrong documentation?
thanks