Skip to content

Add example to print datetime.now as string #114

Open
@robmarkcole

Description

@robmarkcole

Feature Request 🚀

Currently https://docs.pycom.io/firmwareapi/pycom/machine/rtc does not show a nice example of formatting the datetime as a string. This would be useful as the standard python approach doesn't appear to work - rtc.now() returns a tuple and strftime is not anywhere in the pycom library from what I can see.

>>> rtc.now()
(2018, 11, 9, 5, 18, 18, 201719, None)
>>> rtc.now().strftime("%m%d%H%M%S")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'strftime'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions