strftime, Circuitpython, Raspberry Pi Pico

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
janjoh
 
Posts: 1
Joined: Fri Jun 18, 2021 9:29 am

strftime, Circuitpython, Raspberry Pi Pico

Post by janjoh »

So, Python novice, running Circuitpython 6.3.0 on a Raspberry Pi Picoandbasically.. where the heck is strftime?

import time, does not seem to give me any formatting tools.

If i import adafruit_datetime, I seem to lose "time.sleep"

Soooo, let's say I have a number of seconds, and want to format those in a nice hh:mm(:ss) , preferably rounding up, so that it will remain as 0:01 until the last second has elapsed.
basically, it's a timer.

I must be missing something fundamental here, but I cannot quite wrap my head around what i need.

Thank you in advance!

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: strftime, Circuitpython, Raspberry Pi Pico

Post by tannewt »

strftime is likely not implemented. CircuitPython's time module is a strict subset of CPython's. So, you'll need to DIY your time formatting.n

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”