Skip to content

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

Closed
@Neradoc

Description

@Neradoc

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions