kopia lustrzana https://github.com/micropython/micropython-lib
![]() Signed-off-by: Matt Trentini <matt.trentini@gmail.com> |
||
---|---|---|
.. | ||
README.md | ||
manifest.py | ||
test_time.py | ||
time.py |
README.md
time
This library extends the built-in MicroPython time
module to
include
time.strftime()
.
strftime()
is omitted from the built-in time
module to conserve space.
Installation
Use mip
via mpremote
:
> mpremote mip install time
See Package management for more details on using mip
and mpremote
.
Common uses
strftime()
is used when using a loggging Formatter
Object that
employs
asctime
.
For example:
logging.Formatter('%(asctime)s | %(name)s | %(levelname)s - %(message)s')
The expected output might look like:
Tue Feb 17 09:42:58 2009 | MAIN | INFO - test
But if this time
extension library isn't installed, asctime
will always be
None
:
None | MAIN | INFO - test