Skip to content

The example in the readme is not compatible with Circuitpython #12

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
Neradoc opened this issue Oct 30, 2021 · 1 comment · Fixed by #13
Closed

The example in the readme is not compatible with Circuitpython #12

Neradoc opened this issue Oct 30, 2021 · 1 comment · Fixed by #13

Comments

@Neradoc
Copy link
Contributor

Neradoc commented Oct 30, 2021

The example in the readme gets 2 errors in Circuitpython:

print("Current UTC time: ", datetime.now(timezone.utc))
Traceback (most recent call last):
  File "code.py", line 13, in <module>
  File "adafruit_datetime.py", line 1356, in now
  File "adafruit_datetime.py", line 1328, in fromtimestamp
  File "adafruit_datetime.py", line 1306, in _fromtimestamp
NotImplementedError: CircuitPython does not currently implement time.gmtime.
print(
    "The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.".format(
        dt, "day", "month", "time"
    )
)
Traceback (most recent call last):
  File "code.py", line 23, in <module>
ValueError: invalid format specifier

Should it be replaced with the simpletest example code ?

@ladyada
Copy link
Member

ladyada commented Oct 30, 2021

yes plz!

Neradoc added a commit to Neradoc/Adafruit_CircuitPython_datetime that referenced this issue Oct 30, 2021
Neradoc added a commit to Neradoc/Adafruit_CircuitPython_datetime that referenced this issue Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants