Skip to content
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

Add example to print datetime.now as string #114

Open
robmarkcole opened this issue Nov 9, 2018 · 0 comments
Open

Add example to print datetime.now as string #114

robmarkcole opened this issue Nov 9, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@robmarkcole
Copy link

robmarkcole commented Nov 9, 2018

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'
@danspndl danspndl added the enhancement New feature or request label Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants