micropython-lib/python-stdlib/time
Marcel Petrick b3125247bf all: Correct various typos in comments and docs.
Non-functional changes only:
- Fixed minor spelling mistakes in comments.
- Corrected typos in user-facing strings.
- No variables, logic, or functional code was modified.

Signed-off-by: Marcel Petrick <mail@marcelpetrick.it>
2025-11-19 00:43:18 +11:00
..
README.md all: Correct various typos in comments and docs. 2025-11-19 00:43:18 +11:00
manifest.py all: Standardise x.y.z versioning for all packages. 2023-07-23 11:48:57 +10:00
test_time.py time: Add unit test for time.strftime. 2022-12-14 11:57:55 +11:00
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 logging 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