8000 mimxrt/machine_rtc: Change format of RTC.datetime to match other ports. by dpgeorge · Pull Request #7383 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

mimxrt/machine_rtc: Change format of RTC.datetime to match other ports. #7383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dpgeorge
Copy link
Member

Following on from #7318, and after discussion #6928 (comment) and also #5553.

The point of this PR is to change RTC.datetime() on the mimxrt port to take/return an 8-tuple in the same format as most of the existing ports (stm32, esp8266, esp32). In the first version of #7318 @robert-hh did already have it this way but I suggested to change it to match CPython's datetime format (see #7318 (comment)). That suggestion was a bit eager because it just introduces too much incompatibility, see #6928 (comment) .

Changes in this PR:

  • change RTC.datetime() to take/return an 8-tuple with format (year, month, day, weekday, hour, minute, second, microsecond)
  • remove unnecessary RTC.weekday()
  • keep behaviour of RTC.now() so it returns (year, month, day, hour, minute, second, microsecond, tzinfo). This matches the docs and the cc3200 port (and no other port has this now() method).

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member Author

Closed in favour of #7382.

@dpgeorge dpgeorge closed this Jun 12, 2021
@dpgeorge dpgeorge deleted the mimxrt-machine-rtc-change-format branch June 12, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0