I have the following code;
oStat=os.stat(oFile)print(time.strftime('%H:%M:%S', time.localtime(oStat.st_mtime)))print(f"{time.localtime(oStat.st_mtime):%H:%M:%S}")
The first print statement works as expected; the f-string gives me:
print(f"{time.localtime(oStat.st_mtime):%H:%M:%S}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TypeError: unsupported format string passed to time.struct_time.__format__
The desired output should be a time eg:
14:10:02
Why is this in error and how can I fix it?
I've tried various combinations but none work.