In machine.RTC().datetime(), microseconds are always 0. #15424
Replies: 2 comments 2 replies
-
The support for microseconds was removed because it did not add any additional value to using ticks_us(). The RTC itself does not provide a microsecond value. Instead the counter of ticks_us() was used simulate the RTC µs value. But the RTC and the ticks_us() counter are not synchronized and will have a drift. Usually after a few hours the difference will accumulate to 1 second. For getting µs time differences, using ticks_us() works better, since the call itself takes way less time. |
Beta Was this translation helpful? Give feedback.
-
Roberts, something like: .. method:: RTC.datetime([datetimetuple])
Get or set the date and time of the RTC.
With no arguments, this method returns an 8-tuple with the current
date and time. With 1 argument (being an 8-tuple) it sets the date
and time.
The 8-tuple has the following format:
(year, month, day, weekday, hours, minutes, seconds, subseconds)
-The meaning of the ``subseconds`` field is hardware dependent.
+In v1.23.0 the support for subseconds was removed because it did not add any additional value to using ticks_us().
+The RTC itself does not provide a microsecond value. |
Beta Was this translation helpful? Give feedback.
-
Dear MicroPython Community
In machine.RTC().datetime(), microseconds are always 0.
V1.20.0 ~ V1.23.0
MicroPython v1.23.0 on 2024-06-02; Teensy 4.1 with MIMXRT1062DVJ6A
MicroPython v1.19.1 on 2022-06-18; Teensy 4.1 with MIMXRT1062DVJ6A
Please fix it in the next version.
Thank you for your time and assistance.
Beta Was this translation helpful? Give feedback.
All reactions