what is the problem in this- string=strftime("%H:%M:%S %P")
when i run the code it called me
string=strftime("%H:%M:%S %P")
ValueError: Invalid format string
what is the solution please tell me.
what is the problem in this- string=strftime("%H:%M:%S %P")
when i run the code it called me
string=strftime("%H:%M:%S %P")
ValueError: Invalid format string
what is the solution please tell me.
This works great, although without %p
from datetime import datetime
n = datetime.now()
string=n.strftime("%H:%M:%S")
print(string)
To understand why it might not work with %p read this: https://stackoverflow.com/a/38863256/3847725